Patch #461321: Support None as a timeout in poll2 and poll3.
This commit is contained in:
parent
2777c021fc
commit
f6cc07cffe
|
@ -110,8 +110,9 @@ def poll2 (timeout=0.0, map=None):
|
||||||
import poll
|
import poll
|
||||||
if map is None:
|
if map is None:
|
||||||
map=socket_map
|
map=socket_map
|
||||||
# timeout is in milliseconds
|
if timeout is not None:
|
||||||
timeout = int(timeout*1000)
|
# timeout is in milliseconds
|
||||||
|
timeout = int(timeout*1000)
|
||||||
if map:
|
if map:
|
||||||
l = []
|
l = []
|
||||||
for fd, obj in map.items():
|
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
|
# Use the poll() support added to the select module in Python 2.0
|
||||||
if map is None:
|
if map is None:
|
||||||
map=socket_map
|
map=socket_map
|
||||||
# timeout is in milliseconds
|
if timeout is not None:
|
||||||
timeout = int(timeout*1000)
|
# timeout is in milliseconds
|
||||||
|
timeout = int(timeout*1000)
|
||||||
pollster = select.poll()
|
pollster = select.poll()
|
||||||
if map:
|
if map:
|
||||||
for fd, obj in map.items():
|
for fd, obj in map.items():
|
||||||
|
|
Loading…
Reference in New Issue