Skip to content

Commit 9533c4f

Browse files
committed
replaced random.choices() with random.choice()
1 parent e1ec7b3 commit 9533c4f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sasctl/utils/misc.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,7 @@ def random_string(length):
4747
str
4848
4949
"""
50-
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
50+
51+
# random.choices() wasn't added until Python 3.6, so repeatedly call .choice() instead
52+
chars = string.ascii_letters + string.digits
53+
return ''.join(random.choice(chars) for _ in range(length))

0 commit comments

Comments
 (0)