Ticket #137: bug-137.patch
File bug-137.patch, 726 bytes (added by , 18 years ago) |
---|
-
generate-python-exceptions.in
116 116 } 117 117 %} 118 118 119 // Python really wants to have its "global interpreter lock" released 120 // during calls that may take time. The exception handler is the 121 // most convenient place to do this. 122 // We should use Py_BEGIN_ALLOW_THREADS et al, but the use of exceptions 123 // prevents that. 119 124 %exception { 125 PyThreadState *_save = PyEval_SaveThread(); 120 126 try { 121 127 $action 128 PyEval_RestoreThread(_save); 122 129 } catch (...) { 130 PyEval_RestoreThread(_save); 123 131 XapianSetPythonException(); 124 132 SWIG_fail; 125 133 }