From 4f7784cca392d49898c68a2c4ca9c4d6b4b4ca28 Mon Sep 17 00:00:00 2001 From: Andy Zhang <37402126+AnzhiZhang@users.noreply.github.com> Date: Sat, 9 Nov 2024 12:59:54 +0000 Subject: [PATCH] =?UTF-8?q?fix(info):=20=F0=9F=A9=B9=20default=20value=20f?= =?UTF-8?q?or=20brand=5Fraw=20(resolve=20#241)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/info/info/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/info/info/__init__.py b/src/info/info/__init__.py index b821d045..946dd370 100644 --- a/src/info/info/__init__.py +++ b/src/info/info/__init__.py @@ -41,7 +41,7 @@ def get_cpu_use(): return f'{average(*psutil.cpu_percent(percpu=True))}%' def get_cpu_brand(): - return cpuinfo.get_cpu_info()['brand_raw'] + return cpuinfo.get_cpu_info().get('brand_raw', 'N/A') def get_memory_use(): used = psutil.virtual_memory().used