<div dir="ltr">Hi all,<div><br></div><div>Installing numpy 1.6.2 against a Python interpreter built with the --without threads currently fails due to missing references to PyGILState_Ensure and PyGILState_Release.  The references appear to be coming from the following code in nditer.c.src:</div>
<div><br></div><div><div>NPY_NO_EXPORT void</div><div>NpyIter_DebugPrint(NpyIter *iter)</div><div>{</div><div>// <snip></div><div>    PyGILState_STATE gilstate = PyGILState_Ensure();</div></div><div><div>// <snip></div>
</div><div><div>    PyGILState_Release(gilstate);</div></div><div>}</div><div><br></div><div>Since this is debugging code, I'm guessing it doesn't get called very frequently, and I could probably just #ifdef it out or use the NPY macros for grabbing the GIL for a non-threaded build: (NPY_ALLOW_C_API and NPY_DISABLE_C_API), but I don't understand why it's grabbing the GIL in the first place.  Where is it calling into the interpreter?  Does it need the GIL for something else?  I'm hesitant to touch this code and issue a pull request until I understand what it's trying to do.</div>
<div><br></div><div>Heading on over to the master branch at numpy/numpy, I'm starting to notice more unprotected PyGILState references creeping into the development code.  Even the Python developers seem to think that nobody is using --without-threaded, so I'm not going to make a strong case for being more careful, but I do want to point it out in case you want to keep the numpy sources correct for this case.</div>
<div><br></div><div>Thanks,</div><div>Aron</div></div>