More robust check for socket timeout error code (Fixes #106)

This commit is contained in:
Miguel Grinberg
2023-04-24 18:24:16 +01:00
parent 239cf4ff37
commit efec9f14be

View File

@@ -1164,7 +1164,7 @@ class Microdot():
req = Request.create(self, stream, addr, sock)
res = self.dispatch_request(req)
except socket_timeout_error as exc: # pragma: no cover
if exc.errno and exc.errno not in [60, 110]:
if exc.errno and exc.errno != errno.ETIMEDOUT:
print_exception(exc) # not a timeout
except Exception as exc: # pragma: no cover
print_exception(exc)