Removing obsolete proxy handling code (Python < 2.6)

This commit is contained in:
Miroslav Stampar
2013-01-18 11:30:52 +01:00
parent e7576a3b11
commit 17d36684b5
2 changed files with 1 additions and 118 deletions

View File

@@ -131,7 +131,6 @@ from lib.parse.payloads import loadPayloads
from lib.request.basic import checkCharEncoding
from lib.request.connect import Connect as Request
from lib.request.dns import DNSServer
from lib.request.proxy import ProxyHTTPSHandler
from lib.request.basicauthhandler import SmartHTTPBasicAuthHandler
from lib.request.certhandler import HTTPSCertAuthHandler
from lib.request.httpshandler import HTTPSHandler
@@ -970,17 +969,7 @@ def _setHTTPProxy():
proxyString = ""
proxyString += "%s:%d" % (hostname, port)
# Workaround for http://bugs.python.org/issue1424152 (urllib/urllib2:
# HTTPS over (Squid) Proxy fails) as long as HTTP over SSL requests
# can't be tunneled over an HTTP proxy natively by Python (<= 2.5)
# urllib2 standard library
if PYVERSION >= "2.6":
proxyHandler = urllib2.ProxyHandler({"http": proxyString, "https": proxyString})
elif conf.scheme == "https":
proxyHandler = ProxyHTTPSHandler(proxyString)
else:
proxyHandler = urllib2.ProxyHandler({"http": proxyString})
proxyHandler = urllib2.ProxyHandler({"http": proxyString, "https": proxyString})
def _setSafeUrl():
"""