summaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2004-06-03 09:18:35 +0000
committerMartin v. Löwis <martin@v.loewis.de>2004-06-03 09:18:35 +0000
commiteac324b90bc76c5c8e305d567c40d53e3440593e (patch)
tree3f079f90a27f1d0b396523bdcf1fb7591c1b693e /Lib
parent3e501dcfc76d948ef5cdee5815ab6ba09fa109a7 (diff)
downloadcpython-git-eac324b90bc76c5c8e305d567c40d53e3440593e.tar.gz
Patch #957240: Add count parameter to asyncore.loop.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncore.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index 69318c88b9..b687fd2cdb 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=1e309):
if map is None:
map = socket_map
@@ -166,8 +166,9 @@ def loop(timeout=30.0, use_poll=False, map=None):
else:
poll_fun = poll
- while map:
+ while map and count >= 0:
poll_fun(timeout, map)
+ count = count - 1
class dispatcher: