Ticket #137: bug-137.patch

File bug-137.patch, 726 bytes (added by Mark Hammond, 17 years ago)

patch (but it turns out generate-python-exceptions.in is changed, not except.i)

  • generate-python-exceptions.in

     
    116116}
    117117%}
    118118
     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.
    119124%exception {
     125    PyThreadState *_save = PyEval_SaveThread();
    120126    try {
    121127        $action
     128        PyEval_RestoreThread(_save);
    122129    } catch (...) {
     130        PyEval_RestoreThread(_save);
    123131        XapianSetPythonException();
    124132        SWIG_fail;
    125133    }