Print warning when server.timeout is used with Python < 3.5.2

This commit is contained in:
Unrud 2017-08-25 19:13:10 +02:00
parent 2df009fac8
commit d96faa35dd

View File

@ -124,6 +124,10 @@ class HTTPServer(wsgiref.simple_server.WSGIServer):
self.server_close() self.server_close()
raise raise
if self.client_timeout and sys.version_info < (3, 5, 2):
self.logger.warning("Using server.timeout with Python < 3.5.2 "
"can cause network connection failures")
def get_request(self): def get_request(self):
# Set timeout for client # Set timeout for client
_socket, address = super().get_request() _socket, address = super().get_request()