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