diff options
author | Kenneth Reitz <me@kennethreitz.com> | 2014-01-08 13:53:23 -0500 |
---|---|---|
committer | Kenneth Reitz <me@kennethreitz.com> | 2014-01-08 13:53:23 -0500 |
commit | df1c2335c82165b961b8a0361d0176cdb298e513 (patch) | |
tree | 7fcf397321be4a85ad4a757751568a4082b02305 /requests/utils.py | |
parent | 1500632b602be698bfce682daeb01a2d64fc2d39 (diff) | |
parent | b17cad65cf27646f0680954914ab31abd4f626c9 (diff) | |
download | python-requests-fix-pickling-adapters.tar.gz |
Merge branch 'master' into fix-pickling-adaptersfix-pickling-adapters
Conflicts:
AUTHORS.rst
Diffstat (limited to 'requests/utils.py')
-rw-r--r-- | requests/utils.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/requests/utils.py b/requests/utils.py index c7e2b089..e69e9a81 100644 --- a/requests/utils.py +++ b/requests/utils.py @@ -487,7 +487,16 @@ def get_environ_proxies(url): # If the system proxy settings indicate that this URL should be bypassed, # don't proxy. - if proxy_bypass(netloc): + # The proxy_bypass function is incredibly buggy on OS X in early versions + # of Python 2.6, so allow this call to fail. Only catch the specific + # exceptions we've seen, though: this call failing in other ways can reveal + # legitimate problems. + try: + bypass = proxy_bypass(netloc) + except (TypeError, socket.gaierror): + bypass = False + + if bypass: return {} # If we get here, we either didn't have no_proxy set or we're not going |