diff options
author | Pauli Virtanen <pav@iki.fi> | 2013-04-13 16:14:04 +0300 |
---|---|---|
committer | Pauli Virtanen <pav@iki.fi> | 2013-04-13 16:14:04 +0300 |
commit | 68c186d1e8413b8049128624746f29851d560f1a (patch) | |
tree | 790e42e7020920b36916690279074c7908309f6e /numpy | |
parent | fb9b5bd2d71c92f64f151f812b4cee08a971eb2e (diff) | |
download | numpy-68c186d1e8413b8049128624746f29851d560f1a.tar.gz |
BUG: linalg: do not assume that GIL is enabled in xerbla_
With the new ufunc-based linalg, GIL is released in ufuncs, and needs to
be reacquired when raising errors in xerbla_.
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/linalg/lapack_lite/python_xerbla.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/numpy/linalg/lapack_lite/python_xerbla.c b/numpy/linalg/lapack_lite/python_xerbla.c index 4e5a68413..8bd069842 100644 --- a/numpy/linalg/lapack_lite/python_xerbla.c +++ b/numpy/linalg/lapack_lite/python_xerbla.c @@ -26,12 +26,16 @@ int xerbla_(char *srname, integer *info) 6 for name, 4 for param. num. */ int len = 0; /* length of subroutine name*/ + PyGILState_STATE save; + while( len<6 && srname[len]!='\0' ) len++; while( len && srname[len-1]==' ' ) len--; snprintf(buf, sizeof(buf), format, len, srname, *info); + save = PyGILState_Ensure(); PyErr_SetString(PyExc_ValueError, buf); + PyGILState_Release(save); return 0; } |