Re: [C++-sig] Catching Boost.Python.ArgumentError

2010-04-26 Thread Alex Mohr
On 4/26/2010 1:22 AM, Austin Bingham wrote: I feel like I'm missing something simple, but how do I catch Boost.Python.ArgumentException? As far as I can tell, the Boost.Python module is not something I can import explicitly, so I can't write "catch Boost.Python.ArgumentException:". I can do somet

Re: [C++-sig] Catching Boost.Python.ArgumentError

2010-04-26 Thread Ralf W. Grosse-Kunstleve
The best you can do is: try: foo("abc") except Exception, e: if (not str(e).startswith("Python argument types in")): raise print "continue" - Original Message From: Austin Bingham To: Cplusplus-sig@python.org Sent: Mon, April 26, 2010 1:22:41

[C++-sig] Catching Boost.Python.ArgumentError

2010-04-26 Thread Austin Bingham
I feel like I'm missing something simple, but how do I catch Boost.Python.ArgumentException? As far as I can tell, the Boost.Python module is not something I can import explicitly, so I can't write "catch Boost.Python.ArgumentException:". I can do something like comparing type and module name strin