From: Arto V. <av...@ik...> - 2009-12-02 06:46:01
|
> What SWIG version are you using? If it recent SVN trunk as the attached > patch suggests? Yes, I updated it yesterday from SVN trunk. Same problem exist with latest release (1.3.40). > >> e.g. using a simple interface: >> >> /* some exception handlers, typemaps, includes etc omitted */ > > Please don't omit stuff like this - if you give us a complete interface file > we can feed it to swig ourselves. If you only give us part of it, we can't > without recreating the missing part. Personally I don't usually have the time > to do so. Ok - i can provide as attachment full set of sources for my test case. > Much simpler would be: > > try { > SWIG_PYTHON_THREAD_BEGIN_ALLOW; > (arg1)->bar(); > } > catch (Error &e) { > PyErr_SetString(PyExc_RuntimeError, e); > SWIG_fail; > } > > In C++, the SWIG_PYTHON_THREAD_END_ALLOW happens implicitly when we leave the > block containing SWIG_PYTHON_THREAD_BEGIN_ALLOW (either normally or via an > exception), and the try/catch here means this must be C++ code. In C code > the SWIG_PYTHON_THREAD_END_ALLOW needs to be explicit. Ok. I did not realize that there was different macro for c++. I modified my patch to use the method you suggest above, when it is generating catchlist. > Did you try running SWIG's test suite with your patch applied? I run python, lua and ruby check-examples/check-test-suite. They seem to be ok. As attachment there is a new patch and full set of sources for my test. BR, Arto |