Skip to content

Commit fcf7a5f

Browse files
committed
Fix cross-interpreter NotShareableError ref handling
1 parent 9e863fa commit fcf7a5f

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

Python/crossinterp_data_lookup.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ _PyXI_UnwrapNotShareableError(PyThreadState * tstate, _PyXI_failure *failure)
100100
if (failure != NULL) {
101101
_PyXI_errcode code = _PyXI_ERR_NOT_SHAREABLE;
102102
if (_PyXI_InitFailure(failure, code, exc) < 0) {
103+
Py_DECREF(exc);
103104
return -1;
104105
}
105106
}

Python/crossinterp_exceptions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ _ensure_notshareableerror(PyThreadState *tstate,
8383
// A NotShareableError instance is already set.
8484
assert(cause == NULL);
8585
_PyErr_SetRaisedException(tstate, ctx);
86+
return;
8687
}
8788
}
8889
else {

0 commit comments

Comments
 (0)