File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1090,8 +1090,7 @@ def proxy_info_from_environment(method="http"):
10901090 if method not in ["http" , "https" ]:
10911091 return
10921092
1093- env_var = method + "_proxy"
1094- url = os .environ .get (env_var , os .environ .get (env_var .upper ()))
1093+ url = urllib .getproxies ().get (method )
10951094 if not url :
10961095 return
10971096 return proxy_info_from_url (url , method , None )
@@ -1628,7 +1627,7 @@ def __init__(
16281627 `proxy_info` may be:
16291628 - a callable that takes the http scheme ('http' or 'https') and
16301629 returns a ProxyInfo instance per request. By default, uses
1631- proxy_nfo_from_environment .
1630+ proxy_info_from_environment .
16321631 - a ProxyInfo instance (static proxy config).
16331632 - None (proxy disabled).
16341633
Original file line number Diff line number Diff line change 4040import ssl
4141import sys
4242import time
43- import urllib .parse
43+ import urllib .parse , urllib . request
4444import zlib
4545
4646try :
@@ -1071,8 +1071,7 @@ def proxy_info_from_environment(method="http"):
10711071 if method not in ("http" , "https" ):
10721072 return
10731073
1074- env_var = method + "_proxy"
1075- url = os .environ .get (env_var , os .environ .get (env_var .upper ()))
1074+ url = urllib .request .getproxies ().get (method )
10761075 if not url :
10771076 return
10781077 return proxy_info_from_url (url , method , noproxy = None )
You can’t perform that action at this time.
0 commit comments