Commit 19cd0aaf authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki Committed by Jérome Perrin

fixup! py2/py3: string.letters is locale-dependent and removed in Python 3.

parent 57d6829c
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
""" """
from random import choice from random import choice
from string import letters, digits from string import ascii_letters, digits
character_set = '' character_set = ''
if include_letters: if include_letters:
character_set = '%s%s' %(character_set, letters) character_set = '%s%s' %(character_set, ascii_letters)
if include_digits: if include_digits:
character_set = '%s%s' %(character_set, digits) character_set = '%s%s' %(character_set, digits)
return ''.join([choice(character_set) for _ in range(int(string_length))]) return ''.join([choice(character_set) for _ in range(int(string_length))])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment