summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_timeout.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-06-13 15:07:44 (GMT)
committerGuido van Rossum <guido@python.org>2002-06-13 15:07:44 (GMT)
commit11ba094957ed72d0ecc9e50e79d138a0770df6e3 (patch)
tree029b200e2794fdb9231f42cc77d3120b81ac5c96 /Lib/test/test_timeout.py
parentdfad1a9039df367c9a403e2b777fe2690f3b5b88 (diff)
downloadcpython-11ba094957ed72d0ecc9e50e79d138a0770df6e3.zip
cpython-11ba094957ed72d0ecc9e50e79d138a0770df6e3.tar.gz
cpython-11ba094957ed72d0ecc9e50e79d138a0770df6e3.tar.bz2
Major overhaul of timeout sockets:
- setblocking(0) and settimeout(0) are now equivalent, and ditto for setblocking(1) and settimeout(None). - Don't raise an exception from internal_select(); let the final call report the error (this means you will get an EAGAIN error instead of an ETIMEDOUT error -- I don't care). - Move the select to inside the Py_{BEGIN,END}_ALLOW_THREADS brackets, so other theads can run (this was a bug in the original code). - Redid the retry logic in connect() and connect_ex() to avoid masking errors. This probably doesn't work for Windows yet; I'll fix that next. It may also fail on other platforms, depending on what retrying a connect does; I need help with this. - Get rid of the retry logic in accept(). I don't think it was needed at all. But I may be wrong.
Diffstat (limited to 'Lib/test/test_timeout.py')
-rw-r--r--Lib/test/test_timeout.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py
index 8a84258..7c72222 100644
--- a/Lib/test/test_timeout.py
+++ b/Lib/test/test_timeout.py
@@ -59,17 +59,17 @@ class CreationTestCase(unittest.TestCase):
self.assertRaises(ValueError, self.sock.settimeout, -1L)
self.assertRaises(ValueError, self.sock.settimeout, -1.0)
- def testTimeoutThenoBlocking(self):
+ def testTimeoutThenBlocking(self):
"Test settimeout() followed by setblocking()"
self.sock.settimeout(10)
self.sock.setblocking(1)
self.assertEqual(self.sock.gettimeout(), None)
self.sock.setblocking(0)
- self.assertEqual(self.sock.gettimeout(), None)
+ self.assertEqual(self.sock.gettimeout(), 0.0)
self.sock.settimeout(10)
self.sock.setblocking(0)
- self.assertEqual(self.sock.gettimeout(), None)
+ self.assertEqual(self.sock.gettimeout(), 0.0)
self.sock.setblocking(1)
self.assertEqual(self.sock.gettimeout(), None)