Boost logo

Boost Users :

Subject: [Boost-users] [python] intercepting uncaught exceptions
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2011-02-28 13:32:06


Hi,

I am using Boost.Python quite extensively (even stretching it to the limit in
some cases). Now I cave this problem:

Is there any way to intercept uncaught exception in embedded Python code?

I need to add some information to an exception/traceback in this case. I have
full control over environment before embedded code is executed.

I thought I'll be able to use sys.excepthook, but it does not seem to be invoked.

Alternatively I'd can live if I can somehow retrieve the context of failed call
(global/local dict?) in boost::python::error_already_set handler.

Please advise,

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net