summaryrefslogtreecommitdiff
path: root/Modules/socketmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-10-11 09:54:42 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-10-11 09:54:42 +0200
commitbc5b80bac1d3db5779fcace4922bfc7eb8b964fa (patch)
treef2683edb7faa3a850b6a387bdc52166af5525e55 /Modules/socketmodule.c
parentb16e12aaaa3d6b3f47dc1400e900c2d4aae0f337 (diff)
downloadcpython-git-bc5b80bac1d3db5779fcace4922bfc7eb8b964fa.tar.gz
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 d9c70f8665..bae9634ef2 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) */