添加对NOUGAT的代理设置

This commit is contained in:
binary-husky
2023-10-18 16:58:19 +08:00
parent af83c43fb0
commit f925fe7692
2 changed files with 4 additions and 2 deletions

View File

@@ -721,8 +721,10 @@ class nougat_interface():
def nougat_with_timeout(self, command, cwd, timeout=3600):
import subprocess
from toolbox import ProxyNetworkActivate
logging.info(f'正在执行命令 {command}')
process = subprocess.Popen(command, shell=True, cwd=cwd)
with ProxyNetworkActivate("Nougat_Download"):
process = subprocess.Popen(command, shell=True, cwd=cwd, env=os.environ)
try:
stdout, stderr = process.communicate(timeout=timeout)
except subprocess.TimeoutExpired: