From: Georg Brandl Date: Sun, 6 Jan 2008 18:23:30 +0000 (+0000) Subject: Fix exception slicing. X-Git-Tag: v3.0a3~231 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7357c23ee72d687433452555018e9931159a2dfa;p=thirdparty%2FPython%2Fcpython.git Fix exception slicing. --- diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 3829c6128ab9..2ec2e0dce346 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -321,7 +321,7 @@ class dispatcher: conn, addr = self.socket.accept() return conn, addr except socket.error as why: - if why[0] == EWOULDBLOCK: + if why.args[0] == EWOULDBLOCK: pass else: raise @@ -331,7 +331,7 @@ class dispatcher: result = self.socket.send(data) return result except socket.error as why: - if why[0] == EWOULDBLOCK: + if why.args[0] == EWOULDBLOCK: return 0 else: raise @@ -349,7 +349,7 @@ class dispatcher: return data except socket.error as why: # winsock sometimes throws ENOTCONN - if why[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]: + if why.args[0] in [ECONNRESET, ENOTCONN, ESHUTDOWN]: self.handle_close() return b'' else: