File tree 1 file changed +14
-8
lines changed
1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -205,10 +205,13 @@ function _pyjl_serialize(self::PyPtr, ::PyPtr)
205
205
b = take! (io)
206
206
return PyBytes_FromStringAndSize (pointer (b), sizeof (b))
207
207
catch e
208
- PyErr_SetString (
209
- POINTERS. PyExc_Exception,
210
- " error serializing this value. Caught exception $(sprint (showerror, e, catch_backtrace ())) "
211
- )
208
+ PyErr_SetString (POINTERS. PyExc_Exception, " error serializing this value" )
209
+ # wrap sprint in another try-catch block to prevent this function from throwing
210
+ try
211
+ @debug " Caught exception $(sprint (showerror, e, catch_backtrace ())) "
212
+ catch e2
213
+ @debug " Error printing exception: $e2 "
214
+ end
212
215
return PyNULL
213
216
end
214
217
end
@@ -223,10 +226,13 @@ function _pyjl_deserialize(t::PyPtr, v::PyPtr)
223
226
x = deserialize (io)
224
227
return PyJuliaValue_New (t, x)
225
228
catch e
226
- PyErr_SetString (
227
- POINTERS. PyExc_Exception,
228
- " error deserializing this value. Caught exception $(sprint (showerror, e, catch_backtrace ())) "
229
- )
229
+ PyErr_SetString (POINTERS. PyExc_Exception, " error deserializing this value" )
230
+ # wrap sprint in another try-catch block to prevent this function from throwing
231
+ try
232
+ @debug " Caught exception $(sprint (showerror, e, catch_backtrace ())) "
233
+ catch e2
234
+ @debug " Error printing exception: $e2 "
235
+ end
230
236
return PyNULL
231
237
end
232
238
end
You can’t perform that action at this time.
0 commit comments