Commit d5729d0f authored by Denis Bilenko's avatar Denis Bilenko

socket: import _GLOBAL_DEFAULT_TIMEOUT from stdlib's socket instead of creating a new object

parent efe9ff90
......@@ -533,7 +533,11 @@ def tcp_server(listensocket, server, *args, **kw):
finally:
listensocket.close()
_GLOBAL_DEFAULT_TIMEOUT = object()
try:
_GLOBAL_DEFAULT_TIMEOUT = __socket__._GLOBAL_DEFAULT_TIMEOUT
except AttributeError:
_GLOBAL_DEFAULT_TIMEOUT = object()
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT):
"""Connect to *address* and return the socket object.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment