Skip to content

Commit cfcf765

Browse files
authored
[3.14] gh-129559: add bytearray.resize thread safety test for free-threading (GH-141739) (#141835)
[3.14] gh-129559: add `bytearray.resize` thread safety test for free-threading (GH-141739) (cherry picked from commit 019c315)
1 parent 8d5cf98 commit cfcf765

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/test/test_bytes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,6 +2564,10 @@ def zfill(b, a):
25642564
c = a.zfill(0x400000)
25652565
assert not c or c[-1] not in (0xdd, 0xcd)
25662566

2567+
def resize(b, a): # MODIFIES!
2568+
b.wait()
2569+
a.resize(10)
2570+
25672571
def check(funcs, a=None, *args):
25682572
if a is None:
25692573
a = bytearray(b'0' * 0x400000)
@@ -2625,6 +2629,8 @@ def check(funcs, a=None, *args):
26252629
check([clear] + [startswith] * 10)
26262630
check([clear] + [strip] * 10)
26272631

2632+
check([clear] + [resize] * 10)
2633+
26282634
check([clear] + [contains] * 10)
26292635
check([clear] + [subscript] * 10)
26302636
check([clear2] + [ass_subscript2] * 10, None, bytearray(b'0' * 0x400000))

0 commit comments

Comments
 (0)