Kaydet (Commit) 86909b50 authored tarafından Giampaolo Rodolà's avatar Giampaolo Rodolà

rename DISCONNECTED global constant in _DISCONNECTED

üst 985b68e6
...@@ -56,7 +56,7 @@ import os ...@@ -56,7 +56,7 @@ import os
from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \ from errno import EALREADY, EINPROGRESS, EWOULDBLOCK, ECONNRESET, EINVAL, \
ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode ENOTCONN, ESHUTDOWN, EINTR, EISCONN, EBADF, ECONNABORTED, errorcode
DISCONNECTED = frozenset((ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED)) _DISCONNECTED = frozenset((ECONNRESET, ENOTCONN, ESHUTDOWN, ECONNABORTED))
try: try:
socket_map socket_map
...@@ -366,7 +366,7 @@ class dispatcher: ...@@ -366,7 +366,7 @@ class dispatcher:
except socket.error as why: except socket.error as why:
if why.args[0] == EWOULDBLOCK: if why.args[0] == EWOULDBLOCK:
return 0 return 0
elif why.args[0] in DISCONNECTED: elif why.args[0] in _DISCONNECTED:
self.handle_close() self.handle_close()
return 0 return 0
else: else:
...@@ -384,7 +384,7 @@ class dispatcher: ...@@ -384,7 +384,7 @@ class dispatcher:
return data return data
except socket.error as why: except socket.error as why:
# winsock sometimes throws ENOTCONN # winsock sometimes throws ENOTCONN
if why.args[0] in DISCONNECTED: if why.args[0] in _DISCONNECTED:
self.handle_close() self.handle_close()
return b'' return b''
else: 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