diff --git a/blacklist b/badwordlist similarity index 100% rename from blacklist rename to badwordlist diff --git a/captcha-old.py b/captcha-old.py index 3fb2c5c4..358b8e67 100644 --- a/captcha-old.py +++ b/captcha-old.py @@ -172,6 +172,8 @@ def pick_word(words, badwordlist, verbose, nwords, min_length, max_length): sys.exit("Unable to find valid word combinations") def read_wordlist(filename): + if not os.path.isfile(filename): + return [] f = open(filename) words = [x.strip().lower() for x in f.readlines()] f.close() diff --git a/captcha.py b/captcha.py index bb13e21c..fd758bcb 100644 --- a/captcha.py +++ b/captcha.py @@ -189,6 +189,8 @@ def pick_word(words, badwordlist, verbose, nwords, min_length, max_length): sys.exit("Unable to find valid word combinations") def read_wordlist(filename): + if not os.path.isfile(filename): + return [] f = open(filename) words = [x.strip().lower() for x in f.readlines()] f.close()