Skip to content

Commit 3b720ff

Browse files
author
A.Shpak
committed
fix if-statements in windows ids
1 parent 5939f88 commit 3b720ff

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

machineid/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ def id(winregistry: bool = True) -> str:
8484
if platform == 'darwin':
8585
id = __exec__("ioreg -d2 -c IOPlatformExpertDevice | awk -F\\\" '/IOPlatformUUID/{print $(NF-1)}'")
8686
elif platform in ('win32', 'cygwin', 'msys'):
87-
if winregistry and winregistry is not None:
88-
id = __reg__(r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography', 'MachineGuid')
89-
else:
87+
id = __reg__(r'HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography', 'MachineGuid')
88+
if not id:
9089
id = __exec__("powershell.exe -ExecutionPolicy bypass -command (Get-CimInstance -Class Win32_ComputerSystemProduct).UUID")
9190
if not id:
9291
id = __exec__('wmic csproduct get uuid').split('\n')[2] \

0 commit comments

Comments
 (0)