diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2001-10-09 10:10:33 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2001-10-09 10:10:33 (GMT) |
commit | 6ec9a36faf1d29062539bc654358e730395c377e (patch) | |
tree | e19841b9041a5fac2fa779505d6d49bd54249c88 /Lib/asyncore.py | |
parent | cce092d04616b27c25ffc8037206135b72b4b7c4 (diff) | |
download | cpython-6ec9a36faf1d29062539bc654358e730395c377e.zip cpython-6ec9a36faf1d29062539bc654358e730395c377e.tar.gz cpython-6ec9a36faf1d29062539bc654358e730395c377e.tar.bz2 |
Patch #468647: Fix exception propagation in asyncore.
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r-- | Lib/asyncore.py | 72 |
1 files changed, 38 insertions, 34 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index e970162..00b02e3 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -85,26 +85,28 @@ def poll (timeout=0.0, map=None): for fd in r: try: obj = map[fd] - try: - obj.handle_read_event() - except ExitNow: - raise ExitNow - except: - obj.handle_error() except KeyError: - pass + continue + + try: + obj.handle_read_event() + except ExitNow: + raise ExitNow + except: + obj.handle_error() for fd in w: try: obj = map[fd] - try: - obj.handle_write_event() - except ExitNow: - raise ExitNow - except: - obj.handle_error() except KeyError: - pass + continue + + try: + obj.handle_write_event() + except ExitNow: + raise ExitNow + except: + obj.handle_error() def poll2 (timeout=0.0, map=None): import poll @@ -127,17 +129,18 @@ def poll2 (timeout=0.0, map=None): for fd, flags in r: try: obj = map[fd] - try: - if (flags & poll.POLLIN): - obj.handle_read_event() - if (flags & poll.POLLOUT): - obj.handle_write_event() - except ExitNow: - raise ExitNow - except: - obj.handle_error() except KeyError: - pass + continue + + try: + if (flags & poll.POLLIN): + obj.handle_read_event() + if (flags & poll.POLLOUT): + obj.handle_write_event() + except ExitNow: + raise ExitNow + except: + obj.handle_error() def poll3 (timeout=0.0, map=None): # Use the poll() support added to the select module in Python 2.0 @@ -160,17 +163,18 @@ def poll3 (timeout=0.0, map=None): for fd, flags in r: try: obj = map[fd] - try: - if (flags & select.POLLIN): - obj.handle_read_event() - if (flags & select.POLLOUT): - obj.handle_write_event() - except ExitNow: - raise ExitNow - except: - obj.handle_error() except KeyError: - pass + continue + + try: + if (flags & select.POLLIN): + obj.handle_read_event() + if (flags & select.POLLOUT): + obj.handle_write_event() + except ExitNow: + raise ExitNow + except: + obj.handle_error() def loop (timeout=30.0, use_poll=0, map=None): |