[Python-checkins] r54762 - python/trunk/Lib/cgitb.py
georg.brandl
python-checkins at python.org
Wed Apr 11 21:25:14 CEST 2007
Author: georg.brandl
Date: Wed Apr 11 21:25:11 2007
New Revision: 54762
Modified:
python/trunk/Lib/cgitb.py
Log:
Exceptions are no longer old-style instances. Fix accordingly.
Modified: python/trunk/Lib/cgitb.py
==============================================================================
--- python/trunk/Lib/cgitb.py (original)
+++ python/trunk/Lib/cgitb.py Wed Apr 11 21:25:11 2007
@@ -167,7 +167,7 @@
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 @@
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))
More information about the Python-checkins
mailing list