We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1ec7b3 commit 9533c4fCopy full SHA for 9533c4f
src/sasctl/utils/misc.py
@@ -47,4 +47,7 @@ def random_string(length):
47
str
48
49
"""
50
- return ''.join(random.choices(string.ascii_letters + string.digits, k=length))
+
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