内容部分修改

This commit is contained in:
DXC
2026-05-11 17:38:29 +08:00
parent bf4237b160
commit 170d347e21
8 changed files with 284 additions and 47 deletions

View File

@ -31,7 +31,9 @@ def get_cpu_id() -> Optional[str]:
capture_output=True,
text=True,
timeout=5,
creationflags=subprocess.CREATE_NO_WINDOW
creationflags=subprocess.CREATE_NO_WINDOW,
stdin=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
cpu_id = result.stdout.strip().split("\n")[-1].strip()
if cpu_id:
@ -57,7 +59,9 @@ def get_motherboard_uuid() -> Optional[str]:
capture_output=True,
text=True,
timeout=5,
creationflags=subprocess.CREATE_NO_WINDOW
creationflags=subprocess.CREATE_NO_WINDOW,
stdin=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
board_uuid = result.stdout.strip().split("\n")[-1].strip()
board_uuid = re.sub(r'[^a-zA-Z0-9\-]', '', board_uuid)
@ -68,7 +72,9 @@ def get_motherboard_uuid() -> Optional[str]:
["cat", "/sys/class/dmi/id/product_uuid"],
capture_output=True,
text=True,
timeout=5
timeout=5,
stdin=subprocess.DEVNULL,
stderr=subprocess.DEVNULL,
)
if result.returncode == 0:
return result.stdout.strip()