summaryrefslogtreecommitdiff
path: root/mercurial/url.py
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@baserock.org>2011-10-01 20:49:36 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-09-27 13:27:51 +0000
commit921ced43c48c1d170452a7b251b94cc96ec8dd44 (patch)
tree3c4a89176ea67fe4c7bf7b375488361a823c95fa /mercurial/url.py
parent9039c805b0a7e36220101323f82735f08a104b37 (diff)
downloadmercurial-tarball-master.tar.gz
Imported from /srv/lorry/lorry-area/mercurial-tarball/mercurial-1.9.3.tar.gz.HEADmercurial-1.9.3master
Diffstat (limited to 'mercurial/url.py')
-rw-r--r--mercurial/url.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/mercurial/url.py b/mercurial/url.py
index 9cb88e0..60b1012 100644
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -135,7 +135,7 @@ def _gen_sendfile(orgsend):
orgsend(self, data)
return _sendfile
-has_https = util.safehasattr(urllib2, 'HTTPSHandler')
+has_https = hasattr(urllib2, 'HTTPSHandler')
if has_https:
try:
_create_connection = socket.create_connection
@@ -192,8 +192,8 @@ class httpconnection(keepalive.HTTPConnection):
# general transaction handler to support different ways to handle
# HTTPS proxying before and after Python 2.6.3.
def _generic_start_transaction(handler, h, req):
- tunnel_host = getattr(req, '_tunnel_host', None)
- if tunnel_host:
+ if hasattr(req, '_tunnel_host') and req._tunnel_host:
+ tunnel_host = req._tunnel_host
if tunnel_host[:7] not in ['http://', 'https:/']:
tunnel_host = 'https://' + tunnel_host
new_tunnel = True
@@ -377,8 +377,7 @@ if has_https:
keyfile = self.auth['key']
certfile = self.auth['cert']
- conn = httpsconnection(host, port, keyfile, certfile, *args,
- **kwargs)
+ conn = httpsconnection(host, port, keyfile, certfile, *args, **kwargs)
conn.ui = self.ui
return conn