Skip to content

Commit 6588d91

Browse files
committed
fix order of ops when using winregistry
1 parent 5306609 commit 6588d91

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

machineid/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def id(winregistry: bool = True) -> str:
8686
elif platform in ('win32', 'cygwin', 'msys'):
8787
if winregistry:
8888
id = __reg__(r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography', 'MachineGuid')
89-
else:
89+
if not id:
9090
id = __exec__("powershell.exe -ExecutionPolicy bypass -command (Get-CimInstance -Class Win32_ComputerSystemProduct).UUID")
9191
if not id:
9292
id = __exec__('wmic csproduct get uuid').split('\n')[2] \

0 commit comments

Comments
 (0)