url: remove Python 2.7 support code
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 21 Feb 2022 12:34:22 -0700
changeset 49027 680322e04f56
parent 49026 2cce2fa5bcf7
child 49028 32ac127c999f
url: remove Python 2.7 support code Differential Revision: https://phab.mercurial-scm.org/D12342
mercurial/url.py
--- a/mercurial/url.py	Tue Mar 01 20:52:32 2022 -0800
+++ b/mercurial/url.py	Mon Feb 21 12:34:22 2022 -0700
@@ -10,7 +10,6 @@
 
 import base64
 import socket
-import sys
 
 from .i18n import _
 from .pycompat import getattr
@@ -343,16 +342,6 @@
         keepalive.HTTPConnection.__init__(self, *args, **kwargs)
         self._create_connection = createconn
 
-    if sys.version_info < (2, 7, 7):
-        # copied from 2.7.14, since old implementations directly call
-        # socket.create_connection()
-        def connect(self):
-            self.sock = self._create_connection(
-                (self.host, self.port), self.timeout, self.source_address
-            )
-            if self._tunnel_host:
-                self._tunnel()
-
 
 class logginghttphandler(httphandler):
     """HTTP handler that logs socket I/O."""