From 5108d08ac904231536d9d972c49cd4686f84ca65 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Sun, 6 Aug 2017 18:18:21 +0200 Subject: [PATCH] Windows asyncore error handler fix - WSAEWOULDBLOCK is now checked on connect and accept --- src/network/asyncore_pollchoose.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/asyncore_pollchoose.py b/src/network/asyncore_pollchoose.py index 3b21d3da..ba156990 100644 --- a/src/network/asyncore_pollchoose.py +++ b/src/network/asyncore_pollchoose.py @@ -550,7 +550,7 @@ class dispatcher: self.connected = False self.connecting = True err = self.socket.connect_ex(address) - if err in (EINPROGRESS, EALREADY, EWOULDBLOCK) \ + if err in (EINPROGRESS, EALREADY, EWOULDBLOCK, WSAEWOULDBLOCK) \ or err == EINVAL and os.name in ('nt', 'ce'): self.addr = address return @@ -567,7 +567,7 @@ class dispatcher: except TypeError: return None except socket.error as why: - if why.args[0] in (EWOULDBLOCK, ECONNABORTED, EAGAIN, ENOTCONN): + if why.args[0] in (EWOULDBLOCK, WSAEWOULDBLOCK, ECONNABORTED, EAGAIN, ENOTCONN): return None else: raise