mirror of
https://github.com/python/cpython
synced 2024-09-04 15:56:13 +00:00
Fix exception slicing.
This commit is contained in:
parent
74f36691db
commit
7357c23ee7
|
@ -321,7 +321,7 @@ def accept(self):
|
|||
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 @@ def send(self, data):
|
|||
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 @@ def recv(self, buffer_size):
|
|||
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:
|
||||
|
|
Loading…
Reference in a new issue