From: michael k. <ko...@gm...> - 2012-10-13 15:04:21
|
Hi. I can't make Python print correct C++ exception that I throw (with exception.what() message). Here's the example: https://dl.dropbox.com/u/12634473/swig_py_exception.tar.bz2 Building: [kornerr@korenmain swig_py_exception]$ make swig -includeall -python -c++ foo.i Exception.h:11: Warning 401: Nothing known about base class 'std::exception'. Ignored. Exception.h:31: Warning 473: Returning a pointer or reference in a director method is not recommended. g++ -fPIC -shared -o _foo.so foo_wrap.cxx -I/usr/include/python2.7 Running: [kornerr@korenmain swig_py_exception]$ ./runfoo Traceback (most recent call last): File "./runfoo", line 4, in <module> a.run() File "/home/kornerr/p/swig_py_exception/foo.py", line 111, in run def run(self): return _foo.A_run(self) foo.Exception As you see, there's some weird warning about std::exception, and in Python there's just 'foo.Exception', nothing like exception.what() message. How do I fix it? Thanks. |