mirror of
https://github.com/python/cpython.git
synced 2025-07-13 06:15:17 +00:00
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) (GH-29827)
(cherry picked from commit 4dfae6f38e
)
This commit is contained in:
parent
209cec8a2a
commit
5b6aa6ce20
4 changed files with 15 additions and 1 deletions
|
@ -903,7 +903,7 @@ print_exception(PyObject *f, PyObject *value)
|
|||
{
|
||||
Py_XDECREF(modulename);
|
||||
PyErr_Clear();
|
||||
err = PyFile_WriteString("<unknown>", f);
|
||||
err = PyFile_WriteString("<unknown>.", f);
|
||||
}
|
||||
else {
|
||||
if (!_PyUnicode_EqualToASCIIId(modulename, &PyId_builtins))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue