summaryrefslogtreecommitdiff
path: root/Lib/tempfile.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2020-11-01 20:02:03 +0900
committerGitHub <noreply@github.com>2020-11-01 20:02:03 +0900
commitd2810054c7ee1b4ce925fc520224b595b53bf4b4 (patch)
treedac8981d72d176507e62e2df0b5d5694f46e5eaa /Lib/tempfile.py
parent2165cea548f961b308050f30d1f042a377651d44 (diff)
downloadcpython-git-d2810054c7ee1b4ce925fc520224b595b53bf4b4.tar.gz
tempfile: Use random.choises() instead of choise() (GH-23068)
Diffstat (limited to 'Lib/tempfile.py')
-rw-r--r--Lib/tempfile.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 770f72c252..c3fe61aa0a 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -143,10 +143,7 @@ class _RandomNameSequence:
return self
def __next__(self):
- c = self.characters
- choose = self.rng.choice
- letters = [choose(c) for dummy in range(8)]
- return ''.join(letters)
+ return ''.join(self.rng.choices(self.characters, k=8))
def _candidate_tempdir_list():
"""Generate a list of candidate temporary directories which