On Tue, Jan 14, 2014 at 6:45 AM, Gary Oberbrunner <ga...@genarts.com> wrote: > > > ----- Original Message ----- >> From: "Giuseppe Corbelli" <giuseppe.corbe...@copanitalia.com> > ... >> What is the exception you see from the python side? something like: >> >> ArgumentError: Python argument types in >> function_name(function_args) >> did not match C++ signature: >> cpp_function_name(cpp_args) > > That's exactly what I'm trying to figure out! The c++ exception gets handled > in handle_exception and it never gets turned into a python exception as far > as I can tell. >
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. Jim _______________________________________________ Cplusplus-sig mailing list Cplusplus-sig@python.org https://mail.python.org/mailman/listinfo/cplusplus-sig