mirror of
https://github.com/python/cpython.git
synced 2025-07-30 06:34:15 +00:00
Revert r42719, because the isinstance() check wasn't redundant; formatting a
string exception was causing a TypeError.
This commit is contained in:
parent
fd3fcf0b35
commit
4a26633e0e
1 changed files with 1 additions and 1 deletions
|
@ -158,7 +158,7 @@ def format_exception_only(etype, value):
|
||||||
"""
|
"""
|
||||||
list = []
|
list = []
|
||||||
if (type(etype) == types.ClassType
|
if (type(etype) == types.ClassType
|
||||||
or issubclass(etype, Exception)):
|
or (isinstance(etype, type) and issubclass(etype, Exception))):
|
||||||
stype = etype.__name__
|
stype = etype.__name__
|
||||||
else:
|
else:
|
||||||
stype = etype
|
stype = etype
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue