summaryrefslogtreecommitdiffstats
path: root/Lib/random.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2021-01-18 18:36:07 (GMT)
committerGitHub <noreply@github.com>2021-01-18 18:36:07 (GMT)
commita90539f5723a4c34430761be8cba97daa8474abf (patch)
treecd80948f85071abff54bff4654c54602c2a7650c /Lib/random.py
parent799722cb0ddb90752cde7798cab543f30623ebf2 (diff)
downloadcpython-a90539f5723a4c34430761be8cba97daa8474abf.zip
cpython-a90539f5723a4c34430761be8cba97daa8474abf.tar.gz
cpython-a90539f5723a4c34430761be8cba97daa8474abf.tar.bz2
bpo-42944 Fix Random.sample when counts is not None (GH-24235) (GH-24243)
Diffstat (limited to 'Lib/random.py')
-rw-r--r--Lib/random.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/random.py b/Lib/random.py
index 190df6a..36e16a9 100644
--- a/Lib/random.py
+++ b/Lib/random.py
@@ -442,7 +442,7 @@ class Random(_random.Random):
raise TypeError('Counts must be integers')
if total <= 0:
raise ValueError('Total of counts must be greater than zero')
- selections = sample(range(total), k=k)
+ selections = self.sample(range(total), k=k)
bisect = _bisect
return [population[bisect(cum_counts, s)] for s in selections]
randbelow = self._randbelow