summaryrefslogtreecommitdiff
path: root/data/_python3.7/proxies.diff
diff options
context:
space:
mode:
Diffstat (limited to 'data/_python3.7/proxies.diff')
-rw-r--r--data/_python3.7/proxies.diff44
1 files changed, 44 insertions, 0 deletions
diff --git a/data/_python3.7/proxies.diff b/data/_python3.7/proxies.diff
new file mode 100644
index 000000000..b4959ace3
--- /dev/null
+++ b/data/_python3.7/proxies.diff
@@ -0,0 +1,44 @@
+--- Python-3.7.3/Lib/urllib/request.py 2019-03-25 20:21:05.000000000 +0000
++++ Python-3.7.3+iPhone/Lib/urllib/request.py 2019-04-12 18:43:13.605127939 +0000
+@@ -2580,21 +2580,28 @@
+
+
+ if sys.platform == 'darwin':
+- from _scproxy import _get_proxy_settings, _get_proxies
+-
+- def proxy_bypass_macosx_sysconf(host):
+- proxy_settings = _get_proxy_settings()
+- return _proxy_bypass_macosx_sysconf(host, proxy_settings)
+-
+- def getproxies_macosx_sysconf():
+- """Return a dictionary of scheme -> proxy server URL mappings.
+-
+- This function uses the MacOSX framework SystemConfiguration
+- to fetch the proxy information.
+- """
+- return _get_proxies()
++ try:
++ from _scproxy import _get_proxy_settings, _get_proxies
+
++ def proxy_bypass_macosx_sysconf(host):
++ proxy_settings = _get_proxy_settings()
++ return _proxy_bypass_macosx_sysconf(host, proxy_settings)
++
++ def getproxies_macosx_sysconf():
++ """Return a dictionary of scheme -> proxy server URL mappings.
++
++ This function uses the MacOSX framework SystemConfiguration
++ to fetch the proxy information.
++ """
++ return _get_proxies()
++
++ except ModuleNotFoundError:
++ # iOS fix:
++ def proxy_bypass_macosx_sysconf(host):
++ return False
+
++ def getproxies_macosx_sysconf():
++ return {}
+
+ def proxy_bypass(host):
+ """Return True, if host should be bypassed.