Commit 942e1a85 authored by Stefan Behnel's avatar Stefan Behnel

make test for new style exceptions run on all Python versions by not actually...

make test for new style exceptions run on all Python versions by not actually testing for new style exceptions :)
parent ed398d7a
__doc__ = """ __doc__ = """
>>> test(Exception('hi')) >>> test(Exception('hi'))
Raising: Exception('hi',) Raising: Exception('hi',)
Caught: <type 'exceptions.Exception'> Exception('hi',) Caught: Exception('hi',)
""" """
import sys import sys
def test(obj): def test(obj):
print "Raising:", repr(obj) print "Raising: %s%r" % (obj.__class__.__name__, obj.args)
try: try:
raise obj raise obj
except: except:
info = sys.exc_info() info = sys.exc_info()
print "Caught: %r %r" % (info[0], info[1]) print "Caught: %s%r" % (obj.__class__.__name__, obj.args)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment