Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9c1d82c

Browse files
committed
Minor bug fix to --proxy with HTTPS target on Python 2.6 - fixes #191.
1 parent bffa06f commit 9c1d82c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/core/option.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
from lib.core.optiondict import optDict
5959
from lib.core.settings import IS_WIN
6060
from lib.core.settings import PLATFORM
61+
from lib.core.settings import PYVERSION
6162
from lib.core.settings import SITE
6263
from lib.core.settings import SUPPORTED_DBMS
6364
from lib.core.settings import SUPPORTED_OS
@@ -546,7 +547,10 @@ def __setHTTPProxy():
546547
# can't be tunneled over an HTTP proxy natively by Python (<= 2.5)
547548
# urllib2 standard library
548549
if conf.scheme == "https":
549-
proxyHandler = ProxyHTTPSHandler(__proxyString)
550+
if PYVERSION >= "2.6":
551+
proxyHandler = urllib2.ProxyHandler({"https": __proxyString})
552+
else:
553+
proxyHandler = ProxyHTTPSHandler(__proxyString)
550554
else:
551555
proxyHandler = urllib2.ProxyHandler({"http": __proxyString})
552556

0 commit comments

Comments
 (0)