##// END OF EJS Templates
url: Remove the proxy env variables only when needed (issue2451)...
Renato Cunha -
r15077:02734d2b stable
parent child Browse files
Show More
@@ -93,13 +93,15 b' class proxyhandler(urllib2.ProxyHandler)'
93 93 proxies = {}
94 94
95 95 # urllib2 takes proxy values from the environment and those
96 # will take precedence if found, so drop them
97 for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
98 try:
99 if env in os.environ:
100 del os.environ[env]
101 except OSError:
102 pass
96 # will take precedence if found. So, if there's a config entry
97 # defining a proxy, drop the environment ones
98 if ui.config("http_proxy", "host"):
99 for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
100 try:
101 if env in os.environ:
102 del os.environ[env]
103 except OSError:
104 pass
103 105
104 106 urllib2.ProxyHandler.__init__(self, proxies)
105 107 self.ui = ui
General Comments 0
You need to be logged in to leave comments. Login now