From c92f24b8a6ab52a7cc9a3e4e319986400f64af26 Mon Sep 17 00:00:00 2001 From: Cody Maloney Date: Wed, 19 Nov 2025 00:33:45 -0800 Subject: [PATCH] gh-129559: Add missing bytearray.resize free threading test Missed the free threading tests in initial implementation. Running the test under thread sanitizer on a free-threaded build didn't find any issues. --- Lib/test/test_bytes.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index 86898bfcab9135..bb9e46568a7660 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -2629,6 +2629,10 @@ def zfill(b, a): c = a.zfill(0x400000) assert not c or c[-1] not in (0xdd, 0xcd) + def resize(b, a): # MODIFIES! + b.wait() + a.resize(10) + def take_bytes(b, a): # MODIFIES! b.wait() c = a.take_bytes() @@ -2702,6 +2706,8 @@ def check(funcs, a=None, *args): check([clear] + [startswith] * 10) check([clear] + [strip] * 10) + check([clear] + [resize] * 10) + check([clear] + [take_bytes] * 10) check([take_bytes_n] * 10, bytearray(b'0123456789' * 0x400)) check([take_bytes_n] * 10, bytearray(b'0123456789' * 5))