mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +00:00
Fix Issue 6706: return None on connect() in case of EWOULDBLOCK/ECONNABORTED error.
This commit is contained in:
parent
abacccc50c
commit
19e9fefc66
4 changed files with 70 additions and 37 deletions
|
|
@ -350,12 +350,15 @@ class dispatcher:
|
|||
# XXX can return either an address pair or None
|
||||
try:
|
||||
conn, addr = self.socket.accept()
|
||||
return conn, addr
|
||||
except socket.error, why:
|
||||
if why.args[0] == EWOULDBLOCK:
|
||||
pass
|
||||
except TypeError:
|
||||
return None
|
||||
except socket.error as why:
|
||||
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