Merge "Make badwordlist optional"

This commit is contained in:
jenkins-bot 2023-08-06 09:22:07 +00:00 committed by Gerrit Code Review
commit 5383436327
3 changed files with 4 additions and 0 deletions

View file

@ -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()

View file

@ -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()