Close #24784: Fix compilation without thread support

Add "#ifdef WITH_THREAD" around cals to:

* PyGILState_Check()
* _PyImport_AcquireLock()
* _PyImport_ReleaseLock()
This commit is contained in:
Victor Stinner 2015-10-11 09:54:42 +02:00
parent 647dac9d6f
commit 92f0113701
3 changed files with 18 additions and 2 deletions

View file

@ -719,8 +719,10 @@ sock_call_ex(PySocketSockObject *s,
int deadline_initialized = 0;
int res;
#ifdef WITH_THREAD
/* sock_call() must be called with the GIL held. */
assert(PyGILState_Check());
#endif
/* outer loop to retry select() when select() is interrupted by a signal
or to retry select()+sock_func() on false positive (see above) */