mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +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
|
@ -808,6 +808,8 @@ class TracebackException:
|
|||
stype = self.exc_type.__qualname__
|
||||
smod = self.exc_type.__module__
|
||||
if smod not in ("__main__", "builtins"):
|
||||
if not isinstance(smod, str):
|
||||
smod = "<unknown>"
|
||||
stype = smod + '.' + stype
|
||||
|
||||
if not issubclass(self.exc_type, SyntaxError):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue