Inspired by SF patch #860326, make the exception formatting by

traceback.py be closer to the built-in formatting.
A few unittests had to be fixed, too.
This commit is contained in:
Guido van Rossum 2006-08-26 20:37:44 +00:00
parent 59baa759e4
commit 6a2a2a0832
6 changed files with 13 additions and 8 deletions

View file

@ -163,6 +163,9 @@ def format_exception_only(etype, value):
"""
stype = etype.__name__
smod = etype.__module__
if smod not in ("exceptions", "__main__", "__builtin__"):
stype = smod + '.' + stype
if not issubclass(etype, SyntaxError):
return [_format_final_exc_line(stype, value)]