Removing '\n' arg negates the need for wordlist.remove(), renamed unused variable 'x' to '_'

This commit is contained in:
Delirious Lettuce 2017-05-24 13:22:41 -06:00
parent 19f2fca2c1
commit bf7735821c

View File

@ -136,11 +136,10 @@ def build_slug():
Returns a random string made from two words from the wordlist, such as "deter-trig".
"""
with open(get_resource_path('wordlist.txt')) as f:
wordlist = f.read().split('\n')
wordlist.remove('')
wordlist = f.read().split()
r = SystemRandom()
return '-'.join(r.choice(wordlist) for x in range(2))
return '-'.join(r.choice(wordlist) for _ in range(2))
def human_readable_filesize(b):