Skip to content
Snippets Groups Projects
Commit 65bdb222 authored by Jiahang Chen's avatar Jiahang Chen
Browse files

delete ast.literal_eval

parent 0bf6d138
No related branches found
No related tags found
No related merge requests found
Pipeline #365948 passed
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment