内容部分修改
This commit is contained in:
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user