else
Fix passwordy sentence join
This commit is contained in:
parent
a62f6e582d
commit
0b57fc67da
1 changed files with 3 additions and 2 deletions
|
@ -59,8 +59,9 @@ def make_sentence(length=None, joiner=' '):
|
||||||
import dictionary.common as common
|
import dictionary.common as common
|
||||||
if length is None:
|
if length is None:
|
||||||
length = DEFAULT_LENGTH
|
length = DEFAULT_LENGTH
|
||||||
result = joiner.join(random.choice(common.words) for x in range(length))
|
words = [random.choice(common.words) for x in range(length)]
|
||||||
result = result.replace(' ', joiner)
|
words = [w.replace(' ', joiner) for w in words]
|
||||||
|
result = joiner.join(words)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in a new issue