From: Rob Lanphier Date: Sun, 20 Nov 2011 06:17:04 +0000 (-0800) Subject: Can't assume Linux always uses /usr/dict/words (Ubuntu doesn't) X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=0ad59892323a61122679c1830f03c412bf593f02;p=redacted-XKCD-password-generator.git Can't assume Linux always uses /usr/dict/words (Ubuntu doesn't) --- diff --git a/xkcd-password.py b/xkcd-password.py index 44fa384..eacb915 100755 --- a/xkcd-password.py +++ b/xkcd-password.py @@ -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