Skip to content

Commit

Permalink
gh-77560: Report possible errors in restoring builtins at finalization (
Browse files Browse the repository at this point in the history
GH-94255)

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 authored Jun 25, 2022
1 parent 75cb3ab commit bec802d
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 bec802d

Please sign in to comment.