Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KWH40
fml40-reference-implementation
Commits
65bdb222
Commit
65bdb222
authored
Nov 24, 2020
by
Jiahang Chen
Browse files
delete ast.literal_eval
parent
0bf6d138
Pipeline
#365948
passed with stages
in 59 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
ml/thing.py
View file @
65bdb222
...
...
@@ -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
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment