From: Nikita Sobolev Date: Mon, 11 Mar 2024 06:38:04 +0000 (+0300) Subject: gh-116576: Fix `Tools/scripts/sortperf.py` sorting the same list (#116577) X-Git-Tag: v3.13.0a5~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4704e55a71c859c5d17cc2747ba62f49da58ea2d;p=thirdparty%2FPython%2Fcpython.git gh-116576: Fix `Tools/scripts/sortperf.py` sorting the same list (#116577) --- diff --git a/Tools/scripts/sortperf.py b/Tools/scripts/sortperf.py index b54681524ac1..1978a6c83dbe 100644 --- a/Tools/scripts/sortperf.py +++ b/Tools/scripts/sortperf.py @@ -130,7 +130,8 @@ class Benchmark: def _prepare_data(self, loops: int) -> list[float]: bench = BENCHMARKS[self._name] - return [bench(self._size, self._random)] * loops + data = bench(self._size, self._random) + return [data.copy() for _ in range(loops)] def add_cmdline_args(cmd: list[str], args) -> None: