What is the correct way to propagate exceptions from Python callbacks?
When I do this:
Python -> C++ -> Python Callback
(example attached) an exception raised in the callback doesn't make it back
across C++ to Python.
It appears that PyGILState_Release() at the bottom of the
Thomas Heller:
|> Python -> C++ -> Python Callback
|>
|> (example attached) an exception raised in the callback doesn't make it back
|> across C++ to Python.
...
|> void callback_wrapper( void *user_data )
|> {
|> // Acquire interpreter lock
|> PyGILState_STATE gstate = PyGILState_
David E. Konerding DSD staff:
|Randall Hopper wrote:
|> Is there a clean way to save the full exception state in the callback
|> before the PyGILState_Release(), and restore it when we return across the
|> C++ wrapper?
...
|I saved the exception state by retrieveing it from sys