swig/Examples/test-suite/python/exception_order_runme.py
Marcelo Matus 54737ee9a9 - recover the proper catching exception mechanism for classes
(throw typemap).

- fix the examples with exception problems and warnings

- proper and consist treatment of basic types (short, unsigned char,...)

  now all are checked for range and sign. Before, this was depending of
  the use of parsing or no parsing, and/or the converter method, and/or
  the use of directors, etc.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5659 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2004-01-21 01:15:10 +00:00

26 lines
363 B
Python

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