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

Skip to content

Commit 11d9b06

Browse files
committed
Fix for #779167: use InternetConfig proxy settings on MacOSX (in addition
to unix-style).
1 parent b36687a commit 11d9b06

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/urllib.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,8 @@ def getproxies_environment():
11871187
proxies[name[:-6]] = value
11881188
return proxies
11891189

1190-
if os.name == 'mac':
1191-
def getproxies():
1190+
if sys.platform == 'darwin':
1191+
def getproxies_internetconfig():
11921192
"""Return a dictionary of scheme -> proxy server URL mappings.
11931193
11941194
By convention the mac uses Internet Config to store
@@ -1221,6 +1221,9 @@ def getproxies():
12211221
def proxy_bypass(x):
12221222
return 0
12231223

1224+
def getproxies():
1225+
return getproxies_environment() or getproxies_internetconfig()
1226+
12241227
elif os.name == 'nt':
12251228
def getproxies_registry():
12261229
"""Return a dictionary of scheme -> proxy server URL mappings.

0 commit comments

Comments
 (0)