/tags/rel-1-3-25/SWIG/Examples/test-suite/python/exception_order_runme.py
Python | 26 lines | 20 code | 6 blank | 0 comment | 7 complexity | 36b1c9827941b27a502c96b50a8f61e9 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- from exception_order import *
- a = A()
- try:
- a.foo()
- except E1,e:
- pass
- except:
- raise RuntimeError, "bad exception order"
- try:
- a.bar()
- except E2,e:
- pass
- except:
- raise RuntimeError, "bad exception order"
- try:
- a.foobar()
- except RuntimeError,e:
- if e.args[0] != "postcatch unknown":
- print "bad exception order",
- raise RuntimeError, e.args