Skip to content

Commit bec802d

Browse files
gh-77560: Report possible errors in restoring builtins at finalization (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.
1 parent 75cb3ab commit bec802d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/pylifecycle.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ finalize_restore_builtins(PyThreadState *tstate)
14621462
}
14631463
PyDict_Clear(interp->builtins);
14641464
if (PyDict_Update(interp->builtins, interp->builtins_copy)) {
1465-
_PyErr_Clear(tstate);
1465+
PyErr_WriteUnraisable(NULL);
14661466
}
14671467
Py_XDECREF(dict);
14681468
}

0 commit comments

Comments
 (0)