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:
Irit Katriel
2021-11-29 10:07:24 +00:00
committed by GitHub
parent 305236e03a
commit 4d2cc3ed46
4 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -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))