mirror of
https://github.com/python/cpython.git
synced 2025-07-08 03:45:36 +00:00
bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726)
This commit is contained in:
parent
e71c12efcd
commit
4dfae6f38e
4 changed files with 15 additions and 1 deletions
|
@ -1022,7 +1022,7 @@ print_exception(struct exception_print_context *ctx, 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