summaryrefslogtreecommitdiff
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-06-07 03:36:20 +0000
committerGuido van Rossum <guido@python.org>2002-06-07 03:36:20 +0000
commite8008f0013f14933aead215891812dd138d798fd (patch)
treed56563e97db3c178a2ec6ef1304a7dc314288f32 /Modules
parent96803b29838753fc6d3a70b9577a2149e50b3b4a (diff)
downloadcpython-git-e8008f0013f14933aead215891812dd138d798fd.tar.gz
I decided to change the interaction between setblocking() and
settimeout(). Already, settimeout() canceled non-blocking mode; now, setblocking() also cancels the timeout. This is easier to document. (XXX should settimeout(0) be an alias for setblocking(0)? They seem to have roughly the same effect. Also, I'm not sure that the code in connect() and accept() is correct in all cases. We'll sort this out soon enough.)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 65187c5ce1..49dd33245f 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -1086,11 +1086,8 @@ sock_setblocking(PySocketSockObject *s, PyObject *arg)
return NULL;
s->sock_blocking = block;
-
- /* If we're not using timeouts, actually set the blocking to give
- old python behavior. */
- if (s->sock_timeout < 0.0)
- internal_setblocking(s, block);
+ s->sock_timeout = -1.0; /* Always clear the timeout */
+ internal_setblocking(s, block);
Py_INCREF(Py_None);
return Py_None;