summaryrefslogtreecommitdiffstats
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-10-11 07:54:42 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-10-11 07:54:42 (GMT)
commit92f0113701c6404f9e1ec90e3260084fc6a2ef09 (patch)
tree2c23a0831d44990092a377c5b905ab96ca227981 /Modules/socketmodule.c
parent647dac9d6fc08b9fad14c10dabe7cc8ee48c8553 (diff)
downloadcpython-92f0113701c6404f9e1ec90e3260084fc6a2ef09.zip
cpython-92f0113701c6404f9e1ec90e3260084fc6a2ef09.tar.gz
cpython-92f0113701c6404f9e1ec90e3260084fc6a2ef09.tar.bz2
Close #24784: Fix compilation without thread support
Add "#ifdef WITH_THREAD" around cals to: * PyGILState_Check() * _PyImport_AcquireLock() * _PyImport_ReleaseLock()
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r--Modules/socketmodule.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index d9c70f8..bae9634 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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) */