Skip to content

Commit c4979fc

Browse files
committed
Python 3 preparation: use string.ascii_letters instead of string.letters.
1 parent 3d009dd commit c4979fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

roundup/password.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def encodePassword(plaintext, scheme, other=None, config=None):
178178
if other is not None:
179179
salt = other
180180
else:
181-
saltchars = './0123456789'+string.letters
181+
saltchars = './0123456789'+string.ascii_letters
182182
salt = random.choice(saltchars) + random.choice(saltchars)
183183
s = crypt.crypt(plaintext, salt)
184184
elif scheme == 'plaintext':
@@ -188,7 +188,7 @@ def encodePassword(plaintext, scheme, other=None, config=None):
188188
return s
189189

190190
def generatePassword(length=12):
191-
chars = string.letters+string.digits
191+
chars = string.ascii_letters+string.digits
192192
password = [random.choice(chars) for x in range(length)]
193193
# make sure there is at least one digit
194194
password[0] = random.choice(string.digits)

0 commit comments

Comments
 (0)