diff options
Diffstat (limited to 'Lib/traceback.py')
| -rw-r--r-- | Lib/traceback.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 454eb1b..56a87dc 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -158,8 +158,12 @@ def format_exception_only(etype, value): """ list = [] if (type(etype) == types.ClassType - or (isinstance(etype, type) and issubclass(etype, Exception))): + or (isinstance(etype, type) and issubclass(etype, BaseException))): stype = etype.__name__ + if not hasattr(etype, '__module__'): + stype = '<unknown>.' + stype + elif etype.__module__ != 'exceptions': + stype = etype.__module__ + '.' + stype else: stype = etype if value is None: |
