mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-127196: Fix crash in _interpreters
, when shared
had invalid encodings (#127220)
This commit is contained in:
parent
8af5781094
commit
087bb48aca
3 changed files with 20 additions and 2 deletions
|
@ -459,7 +459,12 @@ _run_in_interpreter(PyInterpreterState *interp,
|
|||
|
||||
// Prep and switch interpreters.
|
||||
if (_PyXI_Enter(&session, interp, shareables) < 0) {
|
||||
assert(!PyErr_Occurred());
|
||||
if (PyErr_Occurred()) {
|
||||
// If an error occured at this step, it means that interp
|
||||
// was not prepared and switched.
|
||||
return -1;
|
||||
}
|
||||
// Now, apply the error from another interpreter:
|
||||
PyObject *excinfo = _PyXI_ApplyError(session.error);
|
||||
if (excinfo != NULL) {
|
||||
*p_excinfo = excinfo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue