Skip to content

Commit d88f4cb

Browse files
authored
Cleanup
1 parent d7a45cc commit d88f4cb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

keyauth.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,9 @@ class others:
457457
@staticmethod
458458
def get_hwid():
459459
if platform.system() != "Windows":
460-
f = open("/etc/machine-id")
461-
hwid = f.read()
462-
f.close()
463-
return hwid
460+
with open("/etc/machine-id") as f:
461+
hwid = f.read()
462+
return hwid
464463

465464
cmd = subprocess.Popen(
466465
"wmic useraccount where name='%username%' get sid", stdout=subprocess.PIPE, shell=True)

0 commit comments

Comments
 (0)