summaryrefslogtreecommitdiff
path: root/src/saml2/s_utils.py
diff options
context:
space:
mode:
authorClint Byrum <clint@fewbar.com>2015-05-17 01:05:45 -0700
committerClint Byrum <clint@fewbar.com>2015-05-21 00:13:26 -0700
commit317a975c561af7132176db05d3ba684e4ece58d6 (patch)
tree116abe7e010b68fa6ca11298360a95e4c32dafe9 /src/saml2/s_utils.py
parentdc65c85f8f2ed97b0b0f2666b1de157bf4198586 (diff)
downloadpysaml2-317a975c561af7132176db05d3ba684e4ece58d6.tar.gz
Update rndstr to use string.ascii_letters for py3k
Python3 has eliminated string.letters, and also makes dealing with arrays of bytes somewhat tricky. Luckily string.ascii_letters returns str.
Diffstat (limited to 'src/saml2/s_utils.py')
-rw-r--r--src/saml2/s_utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/saml2/s_utils.py b/src/saml2/s_utils.py
index 3aae0be7..9d2391ef 100644
--- a/src/saml2/s_utils.py
+++ b/src/saml2/s_utils.py
@@ -164,8 +164,8 @@ def rndstr(size=16, alphabet=""):
"""
rng = random.SystemRandom()
if not alphabet:
- alphabet = string.letters[0:52] + string.digits
- return str().join(rng.choice(alphabet) for _ in range(size))
+ alphabet = string.ascii_letters[0:52] + string.digits
+ return type(alphabet)().join(rng.choice(alphabet) for _ in range(size))
def sid():