diff options
| author | Giampaolo RodolĂ <g.rodola@gmail.com> | 2010-11-01 15:07:14 (GMT) |
|---|---|---|
| committer | Giampaolo RodolĂ <g.rodola@gmail.com> | 2010-11-01 15:07:14 (GMT) |
| commit | 19e9fefc660d623ce7c31fb008cde1157ae12aba (patch) | |
| tree | 55124f9a3949ae80b5b361330e29c4843680307c /Lib/asyncore.py | |
| parent | abacccc50c891f32c83dcf9ae38fe310ecf87409 (diff) | |
| download | cpython-19e9fefc660d623ce7c31fb008cde1157ae12aba.zip cpython-19e9fefc660d623ce7c31fb008cde1157ae12aba.tar.gz cpython-19e9fefc660d623ce7c31fb008cde1157ae12aba.tar.bz2 | |
Fix Issue 6706: return None on connect() in case of EWOULDBLOCK/ECONNABORTED error.
Diffstat (limited to 'Lib/asyncore.py')
| -rw-r--r-- | Lib/asyncore.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py index 083920c..daf6644 100644 --- a/Lib/asyncore.py +++ b/Lib/asyncore.py @@ -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: |
