diff options
author | Michael W. Hudson <mwh@python.net> | 2004-06-30 09:02:33 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2004-06-30 09:02:33 (GMT) |
commit | d5cf14348269f1faf06322a8c159cc50e98e736b (patch) | |
tree | be46ee57944cdb6d89b9483a65efce83b1fbaab2 /Lib | |
parent | 96b935e6435ea9928f3a11732d07ecfbb9a671d1 (diff) | |
download | cpython-d5cf14348269f1faf06322a8c159cc50e98e736b.zip cpython-d5cf14348269f1faf06322a8c159cc50e98e736b.tar.gz cpython-d5cf14348269f1faf06322a8c159cc50e98e736b.tar.bz2 |
Check in the updated version of patch #957240, which doesn't rely
on the marshalling characteristics of infinities.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/asyncore.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 69318c8..a737728 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -157,7 +157,7 @@ def poll2(timeout=0.0, map=None): poll3 = poll2 # Alias for backward compatibility -def loop(timeout=30.0, use_poll=False, map=None): +def loop(timeout=30.0, use_poll=False, map=None, count=None): if map is None: map = socket_map @@ -166,8 +166,14 @@ def loop(timeout=30.0, use_poll=False, map=None): else: poll_fun = poll - while map: - poll_fun(timeout, map) + if count is None: + while map: + poll_fun(timeout, map) + + else: + while map and count > 0: + poll_fun(timeout, map) + count = count - 1 class dispatcher: @@ -523,3 +529,4 @@ if os.name == 'posix': self._fileno = fd self.socket = file_wrapper(fd) self.add_channel() + |