Locale module screws string.letters, etc. in some cases (e.g. IDLE run)

This commit is contained in:
Miroslav Stampar
2013-06-01 14:06:58 +02:00
parent ca53dfad84
commit 351c70b390
6 changed files with 10 additions and 10 deletions

View File

@@ -931,9 +931,9 @@ def randomStr(length=4, lowercase=False, alphabet=None):
if alphabet:
retVal = "".join(random.choice(alphabet) for _ in xrange(0, length))
elif lowercase:
retVal = "".join(random.choice(string.lowercase) for _ in xrange(0, length))
retVal = "".join(random.choice(string.ascii_lowercase) for _ in xrange(0, length))
else:
retVal = "".join(random.choice(string.letters) for _ in xrange(0, length))
retVal = "".join(random.choice(string.ascii_letters) for _ in xrange(0, length))
return retVal