diff options
author | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-13 01:34:33 (GMT) |
---|---|---|
committer | Anthony Baxter <anthonybaxter@gmail.com> | 2006-04-13 01:34:33 (GMT) |
commit | 57fdcbc60ff8bbb0261f5dba47580194d45c31a3 (patch) | |
tree | 47bfce64626a6f5b70ffd03974ffe146a3960627 /Lib/traceback.py | |
parent | d691f1a35f370321e1cf768b2164308cb20d2b63 (diff) | |
download | cpython-57fdcbc60ff8bbb0261f5dba47580194d45c31a3.zip cpython-57fdcbc60ff8bbb0261f5dba47580194d45c31a3.tar.gz cpython-57fdcbc60ff8bbb0261f5dba47580194d45c31a3.tar.bz2 |
reverting r45321: Patch #860326: traceback.format_exception_only() now
prepends the exception's module name to non-builtin exceptions, like
the interpreter itself does.
broke a number of doctests. should be discussed before checking in (see
discussion on python-dev).
Diffstat (limited to 'Lib/traceback.py')
-rw-r--r-- | Lib/traceback.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/traceback.py b/Lib/traceback.py index 56a87dc..454eb1b 100644 --- a/Lib/traceback.py +++ b/Lib/traceback.py @@ -158,12 +158,8 @@ def format_exception_only(etype, value): """ list = [] if (type(etype) == types.ClassType - or (isinstance(etype, type) and issubclass(etype, BaseException))): + or (isinstance(etype, type) and issubclass(etype, Exception))): 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: |