From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 11 Mar 2024 07:15:51 +0000 (+0100) Subject: [3.12] gh-116576: Fix `Tools/scripts/sortperf.py` sorting the same list (GH-116577... X-Git-Tag: v3.12.3~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=de239beaec886493468af3d0ae5ef1a0babbdde0;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-116576: Fix `Tools/scripts/sortperf.py` sorting the same list (GH-116577) (#116582) gh-116576: Fix `Tools/scripts/sortperf.py` sorting the same list (GH-116577) (cherry picked from commit 4704e55a71c859c5d17cc2747ba62f49da58ea2d) Co-authored-by: Nikita Sobolev --- 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: