Check for connection reset errors on windows

This commit is contained in:
Pedro Algarvio 2016-05-12 13:35:19 +01:00
parent 7a9146981e
commit 3aae5a9c28
No known key found for this signature in database
GPG key ID: BB36BF6584A298FF

View file

@ -278,6 +278,15 @@ class SocketServerRequestHandler(socketserver.StreamRequestHandler):
logger.handle(record)
except (EOFError, KeyboardInterrupt, SystemExit):
break
except socket.error as exc:
try:
if exc.errno == errno.WSAECONNREST:
# Connection reset on windows
break
except AttributeError:
# We're not on windows
pass
log.exception(exc)
except Exception as exc:
log.exception(exc)