summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-09-19 17:31:47 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2001-09-19 17:31:47 (GMT)
commitf6cc07cffe902d8faef5f3cce7a2ea8cda939e02 (patch)
tree2b06e2ed6bb7a2812722d7ebcb5231d2bb8220f7
parent2777c021fc3bf6d2e33c58b774f8cbeb03ebe78c (diff)
downloadcpython-f6cc07cffe902d8faef5f3cce7a2ea8cda939e02.zip
cpython-f6cc07cffe902d8faef5f3cce7a2ea8cda939e02.tar.gz
cpython-f6cc07cffe902d8faef5f3cce7a2ea8cda939e02.tar.bz2
Patch #461321: Support None as a timeout in poll2 and poll3.
-rw-r--r--Lib/asyncore.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index f221d4c..5175002 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -110,8 +110,9 @@ def poll2 (timeout=0.0, map=None):
import poll
if map is None:
map=socket_map
- # timeout is in milliseconds
- timeout = int(timeout*1000)
+ if timeout is not None:
+ # timeout is in milliseconds
+ timeout = int(timeout*1000)
if map:
l = []
for fd, obj in map.items():
@@ -142,8 +143,9 @@ def poll3 (timeout=0.0, map=None):
# Use the poll() support added to the select module in Python 2.0
if map is None:
map=socket_map
- # timeout is in milliseconds
- timeout = int(timeout*1000)
+ if timeout is not None:
+ # timeout is in milliseconds
+ timeout = int(timeout*1000)
pollster = select.poll()
if map:
for fd, obj in map.items():