1 The purpous of this set of files is to illustrate an unexpected behavior
2 of exception handling of swig wrapped c++ libraries with wxPython.
4 - g++ version 2.96 or 3.2
8 Consider the code in one of the foo_main.cxx say foo_main.cxx.minimal:
11 void MyWrappedFunction(void) {
12 try { throw "In thrower"; }
13 catch (const char * str) { cout<<"Exception"<< str << endl; }
20 When compiling this code and executing it one obtains the correct behavior
21 of the exception i.e. ExceptionIn thrower.
22 Now, wrap the above code with swig and invoque the following python
26 foo.MyWrappedFunction()
27 Surprisingly enough the exception won't be caugth, but terminate will
28 catch it and invoke abort.
29 Note that the exception is properly caught when one doesn't import
31 Note that the exception is properly caught when one doesn't import
34 In order to play with this example, try the following:
35 ln -s foo_main.cxx.minimal foo_main.cxx
36 ln -s foo.cxx.minimal foo.cxx