mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
tempfile: Use random.choises() instead of choise() (GH-23068)
This commit is contained in:
parent
2165cea548
commit
d2810054c7
2 changed files with 3 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue