--- 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.