From 047cc110a49e418760d7e2fc6c500446f54101d8 Mon Sep 17 00:00:00 2001 From: shenjack <3695888@qq.com> Date: Sat, 29 Jun 2024 01:04:25 +0800 Subject: [PATCH] aa --- ica-rs/plugins/base.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ica-rs/plugins/base.py b/ica-rs/plugins/base.py index cc94364..86b3ad3 100644 --- a/ica-rs/plugins/base.py +++ b/ica-rs/plugins/base.py @@ -20,8 +20,11 @@ def local_env_info() -> str: # 参考 DR 的 (crash report) cache.write(f"系统: {platform.platform()}\n") # 处理器 - cache.write("|".join([f"{x}%" for x in psutil.cpu_percent(interval=1, percpu=True)])) - cache.write("\n") + try: + cache.write("|".join([f"{x}%" for x in psutil.cpu_percent(interval=1, percpu=True)])) + cache.write("\n") + except OSError: + cache.write("CPU: 未知\n") # Python 版本信息 cache.write(f"{platform.python_implementation()}: {platform.python_version()}-{platform.python_branch()}({platform.python_compiler()})\n") # 内存信息