From 2bc80d76fa13fae453d688fbedca52b3033c868f Mon Sep 17 00:00:00 2001 From: liyl_kl Date: Fri, 23 Feb 2024 15:47:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=8E=AF=E5=A2=83=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=BC=82=E5=B8=B8=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/kytuning/getenv.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/kytuning/getenv.py b/src/kytuning/getenv.py index 2bac62c..d9e120c 100644 --- a/src/kytuning/getenv.py +++ b/src/kytuning/getenv.py @@ -552,7 +552,11 @@ class EnvManager(object): # 导出环境信息到Json def collect(self): - return json.dumps(self.export_env_dict(), indent = 2) + try: + info_json = json.dumps(self.export_env_dict(), indent = 2) + except: + logging.error("export env info to json failed!") + return info_json if __name__ == '__main__': -- Gitee