fix some bugs in linux

This commit is contained in:
binary-husky
2023-05-31 23:49:25 +08:00
parent f60dc371db
commit 61b0e49fed
4 changed files with 15 additions and 8 deletions

View File

@ -783,8 +783,9 @@ class ProxyNetworkActivate():
from toolbox import get_conf
proxies, = get_conf('proxies')
if 'no_proxy' in os.environ: os.environ.pop('no_proxy')
os.environ['HTTP_PROXY'] = proxies['http']
os.environ['HTTPS_PROXY'] = proxies['https']
if proxies is not None:
if 'http' in proxies: os.environ['HTTP_PROXY'] = proxies['http']
if 'https' in proxies: os.environ['HTTPS_PROXY'] = proxies['https']
return self
def __exit__(self, exc_type, exc_value, traceback):