From 4a4d042c417b00e09664b0cb7aefc384c3c3b675 Mon Sep 17 00:00:00 2001 From: simonchuzz <576639857@qq.com> Date: Fri, 13 Oct 2023 22:04:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0windows=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pilot/utils/system_utils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pilot/utils/system_utils.py b/pilot/utils/system_utils.py index 2673edc0e..2a9494796 100644 --- a/pilot/utils/system_utils.py +++ b/pilot/utils/system_utils.py @@ -205,8 +205,12 @@ def get_cpu_info(): except: pass elif os_type == OSType.WINDOWS: - # TODO - raise NotImplementedError + try: + output = subprocess.check_output('wmic cpu get Name', shell=True).decode("utf-8") + lines = output.splitlines() + cpu_info = lines[2].split(':')[-1].strip() + except: + pass return os_type, avx_type, cpu_info, distribution From 300b01ade07e07055a671a986fb30bb9747ceb7e Mon Sep 17 00:00:00 2001 From: simonchuzz <576639857@qq.com> Date: Fri, 13 Oct 2023 22:15:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0windows=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pilot/utils/system_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pilot/utils/system_utils.py b/pilot/utils/system_utils.py index 2a9494796..50b54be0d 100644 --- a/pilot/utils/system_utils.py +++ b/pilot/utils/system_utils.py @@ -206,9 +206,11 @@ def get_cpu_info(): pass elif os_type == OSType.WINDOWS: try: - output = subprocess.check_output('wmic cpu get Name', shell=True).decode("utf-8") + output = subprocess.check_output("wmic cpu get Name", shell=True).decode( + "utf-8" + ) lines = output.splitlines() - cpu_info = lines[2].split(':')[-1].strip() + cpu_info = lines[2].split(":")[-1].strip() except: pass