remove secrets module for generating passwords until this works with python 3.6

This commit is contained in:
Jordan Rodgers 2018-02-11 22:02:06 -05:00
parent 4a2df4d979
commit c2c91b9f37

View file

@ -1,8 +1,7 @@
import secrets
import string
import random
def gen_password(
length,
charset="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"
):
return "".join([secrets.choice(charset) for _ in range(0, length)])
def gen_password(length, charset="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*"):
# use secrets module once this works in python 3.6
return ''.join(random.choice(charset) for x in range(length))