Commit 65bdb222 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

delete ast.literal_eval

parent 0bf6d138
Pipeline #365948 passed with stages
in 59 seconds
......@@ -239,7 +239,12 @@ def receive():
def __on_broker_callback(self, ch, method, properties, body):
if isinstance(body, bytes):
body = ast.literal_eval(body.decode("utf-8"))
body_str = body.decode('utf8').replace("'", '"')
body = json.loads(body_str)
except ValueError:
elif isinstance(body, int):
elif isinstance(body, str):
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment