Kaydet (Commit) 7357c23e authored tarafından Georg Brandl's avatar Georg Brandl

Fix exception slicing.

üst 74f36691
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment