
On Tue, Mar 1, 2011 at 2:13 AM, Gennadiy Rozental
Juraj Ivančić
writes: Boost.Python throws error_already_set exception in case PyErr_Occurred() is true, and here PyErr functions kick in. Perhaps PyErr_Fetch() and PyErr_Restore() are what you're looking for?
These I am using already. The problem is that I am running different pieces of embedded code in different "execution environments" with different global and local dictionaries associated with different Boost.Python object being executed.
I need an ability to treat an error slightly differently depending on which "environment" an error occurred in. Thus I need to know what was the global dictionary at the time (or something similar identifying the "environment").
I hoped I can attach something to the traceback object, but I need to somehow intercept it.
This sounds like a general python/C question; the fact that Boost.Python is throwing an exception is a minor detail in the picture that doesn't affect the answer. You might try asking on the regular Python user's list. -- Dave Abrahams BoostPro Computing http://www.boostpro.com