Skip to content

Commit

Permalink
Update requests/sessions.py
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Prewitt <nate.prewitt@gmail.com>
  • Loading branch information
dbaxa and nateprewitt committed Aug 15, 2021
1 parent 7cc5e5c commit 7442f4e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions requests/sessions.py
Expand Up @@ -289,10 +289,7 @@ def rebuild_proxies(self, prepared_request, proxies):
new_proxies = proxies.copy()
no_proxy = proxies.get('no_proxy')

bypass_proxy = False
if self.trust_env:
bypass_proxy = should_bypass_proxies(url, no_proxy=no_proxy)
if self.trust_env and not bypass_proxy:
if self.trust_env and not should_bypass_proxies(url, no_proxy=no_proxy):
environ_proxies = get_environ_proxies(url, no_proxy=no_proxy)

proxy = environ_proxies.get(scheme, environ_proxies.get('all'))
Expand Down

0 comments on commit 7442f4e

Please sign in to comment.