diff options
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index eb2fdf6..e395ad7 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -162,6 +162,11 @@ def format_exception_only(etype, value): """ + # Gracefully handle (the way Python 2.4 and earlier did) the case of + # being called with (None, None). + if etype is None: + return [_format_final_exc_line(etype, value)] + stype = etype.__name__ smod = etype.__module__ if smod not in ("exceptions", "__main__", "__builtin__"): |