Skip to content

Commit 9a8dcdd

Browse files
Fix an error case.
1 parent c4f9db1 commit 9a8dcdd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/crossinterp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,9 @@ _PyPickle_Loads(struct _unpickle_context *ctx, PyObject *pickled)
674674

675675
finally:
676676
if (exc != NULL) {
677-
sync_module_capture_exc(tstate, &ctx->main);
677+
if (_PyErr_Occurred(tstate)) {
678+
sync_module_capture_exc(tstate, &ctx->main);
679+
}
678680
// We restore the original exception.
679681
// It might make sense to chain it (__context__).
680682
_PyErr_SetRaisedException(tstate, exc);

0 commit comments

Comments
 (0)