Re: [C++-sig] Handling Python exceptions from an exposed C++ function

2014-11-16 Thread Francesco Biscani
Hello Jim, On 16 November 2014 20:23, Jim Bosch wrote: > On Sun, Nov 16, 2014 at 1:51 PM, Francesco Biscani > wrote: > >> >> This can result in an exception being thrown from Python (e.g., >> comparison of a numpy array with zero). What happens in this case is that >> a bp::error_already_set is

Re: [C++-sig] Handling Python exceptions from an exposed C++ function

2014-11-16 Thread Jim Bosch
On Sun, Nov 16, 2014 at 1:51 PM, Francesco Biscani wrote: > > This can result in an exception being thrown from Python (e.g., comparison > of a numpy array with zero). What happens in this case is that > a bp::error_already_set is thrown and not caught by anything, and the > execution terminates.

[C++-sig] Handling Python exceptions from an exposed C++ function

2014-11-16 Thread Francesco Biscani
Hello all, I don't know if the subject makes any sense, but hopefully the description of the problem will make things clearer :) I have a template class which I am exposing to Python with different types instantiated. For the sake of simplicity, let's say it is a Vector class. I have various vers