mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/ConfirmEdit
synced 2024-11-24 00:04:15 +00:00
Merge "Make badwordlist optional"
This commit is contained in:
commit
5383436327
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue