swig/Examples/test-suite/python/exception_order_runme.py
2004-01-12 23:40:58 +00:00

26 lines
452 B
Python

import exception_order
a = exception_order.A()
try:
a.foo()
except RuntimeError,e:
if e.args[0] != "E1":
print "bad exception order",
raise RuntimeError, e.args
try:
a.bar()
except RuntimeError,e:
if e.args[0] != "E2":
print "bad exception order",
raise RuntimeError, e.args
try:
a.foobar()
except RuntimeError,e:
if e.args[0] != "postcatch unknown":
print "bad exception order",
raise RuntimeError, e.args