Bug 950107 - Support ALL_PROXY in bootstraper; r=gps

DONTBUILD (NPOTB)

--HG--
extra : amend_source : cd0913f142f9dfcba18aa5e6925d7a4e6280d975
This commit is contained in:
Maciek 2014-02-05 13:10:00 -08:00
parent 7b57eb0e9b
commit e385dbf8fe

View File

@ -46,7 +46,17 @@ REPOSITORY_PATHS = [
TEMPDIR = None
def setup_proxy():
# Some Linux environments define ALL_PROXY, which is a SOCKS proxy
# intended for all protocols. Python doesn't currently automatically
# detect this like it does for http_proxy and https_proxy.
if 'ALL_PROXY' in os.environ and 'https_proxy' not in os.environ:
os.environ['https_proxy'] = os.environ['ALL_PROXY']
if 'ALL_PROXY' in os.environ and 'http_proxy' not in os.environ:
os.environ['http_proxy'] = os.environ['ALL_PROXY']
def fetch_files(repo_url, repo_type):
setup_proxy()
repo_url = repo_url.rstrip('/')
files = {}