Patchwork D5950: url: always access req._tunnel_host

login
register
mail settings
Submitter phabricator
Date Feb. 16, 2019, 3:34 a.m.
Message ID <8fd700051d91d4c6ac04d801957dd9fc@localhost.localdomain>
Download mbox | patch
Permalink /patch/38780/
State Not Applicable
Headers show

Comments

phabricator - Feb. 16, 2019, 3:34 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd20f1594ff4a: url: always access req._tunnel_host (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5950?vs=14053&id=14118

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

AFFECTED FILES
  mercurial/url.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -179,10 +179,10 @@ 
             return proxyres
         return keepalive.HTTPConnection.getresponse(self)
 
-# general transaction handler to support different ways to handle
-# HTTPS proxying before and after Python 2.6.3.
+# Large parts of this function have their origin from before Python 2.6
+# and could potentially be removed.
 def _generic_start_transaction(handler, h, req):
-    tunnel_host = getattr(req, '_tunnel_host', None)
+    tunnel_host = req._tunnel_host
     if tunnel_host:
         if tunnel_host[:7] not in ['http://', 'https:/']:
             tunnel_host = 'https://' + tunnel_host