Can't assume Linux always uses /usr/dict/words (Ubuntu doesn't)
authorRob Lanphier <redacted>
Sun, 20 Nov 2011 06:17:04 +0000 (22:17 -0800)
committerRob Lanphier <redacted>
Sun, 20 Nov 2011 06:17:04 +0000 (22:17 -0800)
xkcd-password.py

index 44fa384273e146882552f6d73927b73f08206dac..eacb9157d73f352be0d72062f238849bcc8dbc8b 100755 (executable)
@@ -43,11 +43,9 @@ def generate_wordlist(wordfile=None, min_length=5, max_length=9, valid_chars='.'
     """
 
     if wordfile is None:
-        if "darwin" in sys.platform:
-            ## OS X
+        if os.path.exists("/usr/share/dict/words"):
             wordfile = "/usr/share/dict/words"
-        elif "linux" in sys.platform:
-            ## Linux
+        elif os.path.exists("/usr/dict/words"):
             wordfile = "/usr/dict/words"
         else:
             # if we get here wordfile is not set, the try...except block below
git clone https://git.99rst.org/PROJECT