summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-04-21 07:28:26 +0000
committerGeorg Brandl <georg@python.org>2007-04-21 07:28:26 +0000
commit104377b2dee04966ddb45c86c935c5eb71a27ff0 (patch)
treeaeda48293e17d7e4ada7f6aebf17ce2ef5682d95
parent82966e57e87dac929077eb3bfd22cda68b20234c (diff)
downloadcpython-git-104377b2dee04966ddb45c86c935c5eb71a27ff0.tar.gz
Backport r54762: exceptions are no longer old-style instances.
-rw-r--r--Lib/cgitb.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/cgitb.py b/Lib/cgitb.py
index ae25cf13ad..1c300b24ea 100644
--- a/Lib/cgitb.py
+++ b/Lib/cgitb.py
@@ -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))),
pydoc.html.escape(str(evalue)))]
- if type(evalue) is types.InstanceType:
+ if isinstance(evalue, BaseException):
for name in dir(evalue):
if name[:1] == '_': continue
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))
exception = ['%s: %s' % (str(etype), str(evalue))]
- if type(evalue) is types.InstanceType:
+ if isinstance(evalue, BaseException):
for name in dir(evalue):
value = pydoc.text.repr(getattr(evalue, name))
exception.append('\n%s%s = %s' % (" "*4, name, value))