mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
Fix Issue 6706: return None on connect() in case of EWOULDBLOCK/ECONNABORTED error.
This commit is contained in:
parent
8581c7e11a
commit
5ea3d0f95b
4 changed files with 70 additions and 27 deletions
|
@ -346,12 +346,15 @@ class dispatcher:
|
|||
# XXX can return either an address pair or None
|
||||
try:
|
||||
conn, addr = self.socket.accept()
|
||||
return conn, addr
|
||||
except TypeError:
|
||||
return None
|
||||
except socket.error as why:
|
||||
if why.args[0] == EWOULDBLOCK:
|
||||
pass
|
||||
if why.args[0] in (EWOULDBLOCK, ECONNABORTED):
|
||||
return None
|
||||
else:
|
||||
raise
|
||||
else:
|
||||
return conn, addr
|
||||
|
||||
def send(self, data):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue