From 0b57fc67daa99c04c5b70c39efcb9b45ee59e48d Mon Sep 17 00:00:00 2001 From: Voussoir Date: Fri, 26 Jun 2015 14:38:22 -0700 Subject: [PATCH] else Fix passwordy sentence join --- Passwordy/passwordy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Passwordy/passwordy.py b/Passwordy/passwordy.py index 79953fd..ee5a7f4 100644 --- a/Passwordy/passwordy.py +++ b/Passwordy/passwordy.py @@ -59,8 +59,9 @@ def make_sentence(length=None, joiner=' '): import dictionary.common as common if length is None: length = DEFAULT_LENGTH - result = joiner.join(random.choice(common.words) for x in range(length)) - result = result.replace(' ', joiner) + words = [random.choice(common.words) for x in range(length)] + words = [w.replace(' ', joiner) for w in words] + result = joiner.join(words) return result if __name__ == '__main__':