diff options
author | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-01-10 16:19:56 (GMT) |
commit | b940e113bf90ff71b0ef57414ea2beea9d2a4bc0 (patch) | |
tree | 0b9ea19eba1e665dac95126c3140ac2bc36326ad /Lib/asyncore.py | |
parent | 893523e80a2003d4a630aafb84ba016e0070cbbd (diff) | |
download | cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.zip cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.gz cpython-b940e113bf90ff71b0ef57414ea2beea9d2a4bc0.tar.bz2 |
SF patch 1631942 by Collin Winter:
(a) "except E, V" -> "except E as V"
(b) V is now limited to a simple name (local variable)
(c) V is now deleted at the end of the except block
Diffstat (limited to 'Lib/asyncore.py')
-rw-r--r-- | Lib/asyncore.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 7b2f301..9eb6d7f 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -119,7 +119,7 @@ def poll(timeout=0.0, map=None): else: try: r, w, e = select.select(r, w, e, timeout) - except select.error, err: + except select.error as err: if err[0] != EINTR: raise else: @@ -165,7 +165,7 @@ def poll2(timeout=0.0, map=None): pollster.register(fd, flags) try: r = pollster.poll(timeout) - except select.error, err: + except select.error as err: if err[0] != EINTR: raise r = [] @@ -320,7 +320,7 @@ class dispatcher: try: conn, addr = self.socket.accept() return conn, addr - except socket.error, why: + except socket.error as why: if why[0] == EWOULDBLOCK: pass else: @@ -330,7 +330,7 @@ class dispatcher: try: result = self.socket.send(data) return result - except socket.error, why: + except socket.error as why: if why[0] == EWOULDBLOCK: return 0 else: @@ -347,7 +347,7 @@ class dispatcher: return '' else: return data - except socket.error, why: + except socket.error as why: # winsock sometimes throws ENOTCONN if why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]: self.handle_close() |