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).
This commit is contained in:
Anthony Baxter 2006-04-13 01:34:33 +00:00
parent d691f1a35f
commit 57fdcbc60f
3 changed files with 1 additions and 30 deletions

View file

@ -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: