[C++-sig] How to handle argument error exceptions in boost.python?

Gary Oberbrunner garyo at genarts.com
Tue Jan 14 15:24:44 CET 2014



----- Original Message -----
> From: "Jim Bosch" <talljimbo at gmail.com>
...
> My memory on this is a bit fuzzy, but I think it does get translated
> to a custom Boost.Python exception (it's either that or a built-in
> Python exception, which would make your task much more difficult, if
> not impossible).  Unfortunately there's no clear-cut way to import
> that exception.  You could try intentionally raising one in a Python
> try/except block when your module is imported, though, so you could
> store the exception type and reuse it later in subsequent try/except
> blocks.

Thanks Jim; if that's happening, something on the python side must be eating that exception, because I don't see it there.  Still, this is a complex piece of code so it's entirely possible it is being swallowed on the python side.  I'll continue to track it down based on that theory.

-- 
Gary Oberbrunner


More information about the Cplusplus-sig mailing list