diff options
| author | Inada Naoki <songofacandy@gmail.com> | 2020-11-01 20:02:03 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-11-01 20:02:03 +0900 |
| commit | d2810054c7ee1b4ce925fc520224b595b53bf4b4 (patch) | |
| tree | dac8981d72d176507e62e2df0b5d5694f46e5eaa /Lib/tempfile.py | |
| parent | 2165cea548f961b308050f30d1f042a377651d44 (diff) | |
| download | cpython-git-d2810054c7ee1b4ce925fc520224b595b53bf4b4.tar.gz | |
tempfile: Use random.choises() instead of choise() (GH-23068)
Diffstat (limited to 'Lib/tempfile.py')
| -rw-r--r-- | Lib/tempfile.py | 5 |
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 |
