From f7b5bacd7a0b2084ce699eda6f6f4b1adfa16590 Mon Sep 17 00:00:00 2001 From: jonanifranco <66563903+jonanifranco@users.noreply.github.com> Date: Mon, 18 Jan 2021 19:04:29 +0100 Subject: bpo-42944 Fix Random.sample when counts is not None (GH-24235) --- Lib/random.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Lib/random.py') diff --git a/Lib/random.py b/Lib/random.py index db0e6c20fc..30186fc7a3 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -479,7 +479,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 -- cgit v1.2.1