Skip to content

Commit ed2a0eb

Browse files
authored
Simplify socket connection creation
1 parent ce48989 commit ed2a0eb

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

Lib/http/client.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -887,12 +887,7 @@ def __init__(self, host, port=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
887887

888888
self._validate_host(self.host)
889889

890-
# Callable used to open sockets. Kept on the instance so tests
891-
# can replace it; use a thin wrapper so the real
892-
# `socket.create_connection` is invoked at `connect()` time.
893-
# This avoids permanently capturing a patched factory at
894-
# construction time.
895-
self._create_connection = (lambda *a, **kw: socket.create_connection(*a, **kw))
890+
self._create_connection = socket.create_connection
896891

897892
def set_tunnel(self, host, port=None, headers=None):
898893
"""Set up host and port for HTTP CONNECT tunnelling.

0 commit comments

Comments
 (0)