mirror of
https://github.com/python/cpython.git
synced 2026-05-07 05:01:13 -04:00
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) (GH-29826)
(cherry picked from commit 4dfae6f38e)
This commit is contained in:
+1
-1
@@ -972,7 +972,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))
|
||||
|
||||
Reference in New Issue
Block a user