Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
•
7c40573
1
Parent(s):
9f929a0
feat: 优先使用config 里的代理设置
Browse files- modules/config.py +4 -4
modules/config.py
CHANGED
@@ -128,10 +128,10 @@ logging.basicConfig(
|
|
128 |
)
|
129 |
|
130 |
## 处理代理:
|
131 |
-
http_proxy =
|
132 |
-
https_proxy =
|
133 |
-
http_proxy =
|
134 |
-
https_proxy =
|
135 |
|
136 |
# 重置系统变量,在不需要设置的时候不设置环境变量,以免引起全局代理报错
|
137 |
os.environ["HTTP_PROXY"] = ""
|
|
|
128 |
)
|
129 |
|
130 |
## 处理代理:
|
131 |
+
http_proxy = os.environ.get("HTTP_PROXY", "")
|
132 |
+
https_proxy = os.environ.get("HTTPS_PROXY", "")
|
133 |
+
http_proxy = config.get("http_proxy", http_proxy)
|
134 |
+
https_proxy = config.get("https_proxy", https_proxy)
|
135 |
|
136 |
# 重置系统变量,在不需要设置的时候不设置环境变量,以免引起全局代理报错
|
137 |
os.environ["HTTP_PROXY"] = ""
|