Skip to content

Commit dc93175

Browse files
authored
Update password_cracker.py
Check current operating system " if ... else" condition shortened.
1 parent 9c8b037 commit dc93175

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

password_cracker.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
from sys import platform as _platform
1212

1313
# Check the current operating system to import the correct version of crypt
14-
if _platform == "linux" or _platform == "linux2":
14+
if _platform in ["linux", "linux2", "darwin"]: # darwin is _platform name for Mac OS X
1515
import crypt # Import the module
16-
elif _platform == "darwin":
17-
# Mac OS X
18-
import crypt
1916
elif _platform == "win32":
2017
# Windows
2118
try:

0 commit comments

Comments
 (0)