From 97c44b97f41a289399fecb1857658049bbf9a9e7 Mon Sep 17 00:00:00 2001 From: Peter Surda Date: Mon, 29 May 2017 13:14:25 +0200 Subject: [PATCH] Asyncore update - handle WSAENOTSOCK --- src/network/asyncore_pollchoose.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/network/asyncore_pollchoose.py b/src/network/asyncore_pollchoose.py index 02a362a1..39576849 100644 --- a/src/network/asyncore_pollchoose.py +++ b/src/network/asyncore_pollchoose.py @@ -63,6 +63,10 @@ try: from errno import WSAEWOULDBLOCK except (ImportError, AttributeError): WSAEWOULDBLOCK = EWOULDBLOCK +try: + from errno import WSAENOTSOCK +except (ImportError, AttributeError): + WSAENOTSOCK = ENOTSOCK from ssl import SSLError, SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE @@ -201,7 +205,7 @@ def select_poller(timeout=0.0, map=None): except KeyboardInterrupt: return except socket.error as err: - if err.args[0] in (EBADF): + if err.args[0] in (EBADF, WSAENOTSOCK): return for fd in random.sample(r, len(r)):