##// END OF EJS Templates
url: replace uses of hasattr with safehasattr or getattr
Augie Fackler -
r14964:376c32a5 default
parent child Browse files
Show More
@@ -129,7 +129,7 b' def _gen_sendfile(orgsend):'
129 129 orgsend(self, data)
130 130 return _sendfile
131 131
132 has_https = hasattr(urllib2, 'HTTPSHandler')
132 has_https = util.safehasattr(urllib2, 'HTTPSHandler')
133 133 if has_https:
134 134 try:
135 135 _create_connection = socket.create_connection
@@ -186,8 +186,8 b' class httpconnection(keepalive.HTTPConne'
186 186 # general transaction handler to support different ways to handle
187 187 # HTTPS proxying before and after Python 2.6.3.
188 188 def _generic_start_transaction(handler, h, req):
189 if hasattr(req, '_tunnel_host') and req._tunnel_host:
190 tunnel_host = req._tunnel_host
189 tunnel_host = getattr(req, '_tunnel_host', None)
190 if tunnel_host:
191 191 if tunnel_host[:7] not in ['http://', 'https:/']:
192 192 tunnel_host = 'https://' + tunnel_host
193 193 new_tunnel = True
General Comments 0
You need to be logged in to leave comments. Login now