]> granicus.if.org Git - python/commitdiff
Patch #461321: Support None as a timeout in poll2 and poll3.
authorMartin v. Löwis <martin@v.loewis.de>
Wed, 19 Sep 2001 17:31:47 +0000 (17:31 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Wed, 19 Sep 2001 17:31:47 +0000 (17:31 +0000)
Lib/asyncore.py

index f221d4c18e97bf673220aeb08ab7762f7823de33..5175002a3169002a9f225be4b2ca60431385f2ce 100644 (file)
@@ -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():