Skip to content

Commit

Permalink
pythongh-77560: Report possible errors in restoring builtins at final…
Browse files Browse the repository at this point in the history
…ization

Seems in the past the copy of builtins was not made in some scenarios,
and the error was silenced. Write it now to stderr, so we have a chance
to see it.
  • Loading branch information
serhiy-storchaka committed Jun 25, 2022
1 parent 605e9c6 commit d3ef25e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/pylifecycle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ finalize_restore_builtins(PyThreadState *tstate)
}
PyDict_Clear(interp->builtins);
if (PyDict_Update(interp->builtins, interp->builtins_copy)) {
_PyErr_Clear(tstate);
PyErr_WriteUnraisable(NULL);
}
Py_XDECREF(dict);
}
Expand Down

0 comments on commit d3ef25e

Please sign in to comment.