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("'", '"')
try:
body = json.loads(body_str)
except ValueError:
pass
elif isinstance(body, int):
return
elif isinstance(body, str):
......
Markdown is supported
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