File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -102,18 +102,21 @@ def json_packer(obj):
102
102
).encode ("utf8" )
103
103
except ValueError as e :
104
104
# Fallback to trying to clean the json before serializing
105
+ packed = json .dumps (
106
+ json_clean (obj ),
107
+ default = json_default ,
108
+ ensure_ascii = False ,
109
+ allow_nan = False ,
110
+ ).encode ("utf8" )
111
+
105
112
warnings .warn (
106
113
f"Message serialization failed with:\n { e } \n "
107
114
"Supporting this message is deprecated in jupyter-client 7, please make "
108
115
"sure your message is JSON-compliant" ,
109
116
stacklevel = 2 ,
110
117
)
111
- return json .dumps (
112
- json_clean (obj ),
113
- default = json_default ,
114
- ensure_ascii = False ,
115
- allow_nan = False ,
116
- ).encode ("utf8" )
118
+
119
+ return packed
117
120
118
121
119
122
def json_unpacker (s ):
You can’t perform that action at this time.
0 commit comments