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.
diff --git a/Lib/traceback.py b/Lib/traceback.py
index efd0f75..eb2fdf6 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -163,6 +163,9 @@
"""
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)]