mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
Exceptions are no longer old-style instances. Fix accordingly.
This commit is contained in:
parent
13936697f6
commit
135c3174e7
1 changed files with 2 additions and 2 deletions
|
@ -167,7 +167,7 @@ function calls leading up to the error, in the order they occurred.</p>'''
|
||||||
|
|
||||||
exception = ['<p>%s: %s' % (strong(pydoc.html.escape(str(etype))),
|
exception = ['<p>%s: %s' % (strong(pydoc.html.escape(str(etype))),
|
||||||
pydoc.html.escape(str(evalue)))]
|
pydoc.html.escape(str(evalue)))]
|
||||||
if type(evalue) is types.InstanceType:
|
if isinstance(evalue, BaseException):
|
||||||
for name in dir(evalue):
|
for name in dir(evalue):
|
||||||
if name[:1] == '_': continue
|
if name[:1] == '_': continue
|
||||||
value = pydoc.html.repr(getattr(evalue, name))
|
value = pydoc.html.repr(getattr(evalue, name))
|
||||||
|
@ -239,7 +239,7 @@ function calls leading up to the error, in the order they occurred.
|
||||||
frames.append('\n%s\n' % '\n'.join(rows))
|
frames.append('\n%s\n' % '\n'.join(rows))
|
||||||
|
|
||||||
exception = ['%s: %s' % (str(etype), str(evalue))]
|
exception = ['%s: %s' % (str(etype), str(evalue))]
|
||||||
if type(evalue) is types.InstanceType:
|
if isinstance(evalue, BaseException):
|
||||||
for name in dir(evalue):
|
for name in dir(evalue):
|
||||||
value = pydoc.text.repr(getattr(evalue, name))
|
value = pydoc.text.repr(getattr(evalue, name))
|
||||||
exception.append('\n%s%s = %s' % (" "*4, name, value))
|
exception.append('\n%s%s = %s' % (" "*4, name, value))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue