Re: [C++-sig] boost::python::len( list_object) throws "Access violation" (MSDev v9/Boost 1.41)

2010-04-26 Thread John McLaughlin
I believe I have found my problem. I was allowing the GIL to be released (essentially letting multiple threads run concurrently) but the " const boost::python::list & disks" argument was not protected at this point. I can either move the Py_BEGIN_ALLOW_THREADS call to after I am finished access

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 AM Subject: [C++-sig] Catching Bo

[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