Python callbacks & PyGILState_Release()

Randall Hopper viznut at charter.net
Mon Apr 25 23:27:10 EDT 2005


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.exc_info(), which
 |contains all the traceback object data as Python variable.  I think you can
 |get the same info from your C++ callback wrapper, and use PyErr_Fetch and
 |PyErr_Restore to save and restore the exception sate.

Ok, thanks.  I'll give this a shot!

Randy



More information about the Python-list mailing list