I use a library that points out in its API documents to define a class inherited from some specific library class. The library itself is written in C ++, and Python bindings are created using SWIG. The problem is that when I run my Python code, no matter what exception Python throws, I get the error "call ended after calling the instance" Swig :: DirectorMethodException ".
I would like this exception to be thrown by Python code that will be displayed at runtime of my program. Esp, in cases where I get a ZeroDivisionError.
I tried to hack a bit by following the method described in the SWIG documentation at http://www.swig.org/Doc2.0/Python.html#Python_nn36 , but no luck. I still get the same message, “ending the call after calling the instance of“ Swig :: DirectorMethodException ””, regardless of what I put in the module.i file.
Can someone please give me instructions on how to do this, so that Python exceptions are reported like them?
c ++ python exception swig
Madhusudan.CS
source share