https://github.com/python/cpython/commit/cfcf7652f6ae9be84e1973f2d3b1acb40b04ca53
commit: cfcf7652f6ae9be84e1973f2d3b1acb40b04ca53
branch: 3.14
author: Cody Maloney <[email protected]>
committer: kumaraditya303 <[email protected]>
date: 2025-11-22T09:41:20+05:30
summary:
[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 019c315a8e52978da67a3108e441ed5ee376f504)
files:
M Lib/test/test_bytes.py
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py
index 08119f5f769711..1257715586913c 100644
--- a/Lib/test/test_bytes.py
+++ b/Lib/test/test_bytes.py
@@ -2564,6 +2564,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 check(funcs, a=None, *args):
if a is None:
a = bytearray(b'0' * 0x400000)
@@ -2625,6 +2629,8 @@ def check(funcs, a=None, *args):
check([clear] + [startswith] * 10)
check([clear] + [strip] * 10)
+ check([clear] + [resize] * 10)
+
check([clear] + [contains] * 10)
check([clear] + [subscript] * 10)
check([clear2] + [ass_subscript2] * 10, None, bytearray(b'0' *
0x400000))
_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]