diff options
author | Clint Byrum <clint@fewbar.com> | 2015-05-17 01:05:45 -0700 |
---|---|---|
committer | Clint Byrum <clint@fewbar.com> | 2015-05-21 00:13:26 -0700 |
commit | 317a975c561af7132176db05d3ba684e4ece58d6 (patch) | |
tree | 116abe7e010b68fa6ca11298360a95e4c32dafe9 /src/saml2/s_utils.py | |
parent | dc65c85f8f2ed97b0b0f2666b1de157bf4198586 (diff) | |
download | pysaml2-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.py | 4 |
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(): |