Patchwork D12342: url: remove Python 2.7 support code

login
register
mail settings
Submitter phabricator
Date March 4, 2022, 3:33 a.m.
Message ID <differential-rev-PHID-DREV-4x6atsxkiuglu5b3b7an-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50684/
State New
Headers show

Comments

phabricator - March 4, 2022, 3:33 a.m.
indygreg created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12342

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS




To: indygreg, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -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."""