From 07f48e945d33ec924181bcde3f50295ecd9e76ec Mon Sep 17 00:00:00 2001 From: Rikki Date: Sun, 9 Mar 2025 02:51:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A9=E7=94=A8filter=E6=9D=A5?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=E7=9B=B4=E6=8E=A5=E5=88=A0=E9=99=A4key?= =?UTF-8?q?=E9=80=A0=E6=88=90=E7=9A=84=20RuntimeError:=20dictionary=20chan?= =?UTF-8?q?ged=20size=20during=20iteration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bot.py b/bot.py index 446205d03..e4d03435c 100644 --- a/bot.py +++ b/bot.py @@ -83,9 +83,7 @@ def scan_provider(env_config: dict): # 利用未初始化 env 时获取的 env_mask 来对新的环境变量集去重 # 避免 GPG_KEY 这样的变量干扰检查 - for key in env_config: - if key in env_mask: - del env_config[key] + env_config = dict(filter(lambda item: item[0] not in env_mask, env_config.items())) # 遍历 env_config 的所有键 for key in env_config: