diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2024-03-25 15:32:11 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-25 15:32:11 (GMT) |
commit | 0c1a42cf9c8cd0d4534d5c1d58f118ce7c5c446e (patch) | |
tree | 929ca228612a2f48b5e7afa86101fcecb04ad29d /Modules/_testcapimodule.c | |
parent | 01e7405da400e8997f8964d06cc414045e144681 (diff) | |
download | cpython-0c1a42cf9c8cd0d4534d5c1d58f118ce7c5c446e.zip cpython-0c1a42cf9c8cd0d4534d5c1d58f118ce7c5c446e.tar.gz cpython-0c1a42cf9c8cd0d4534d5c1d58f118ce7c5c446e.tar.bz2 |
gh-87193: Support bytes objects with refcount > 1 in _PyBytes_Resize() (GH-117160)
Create a new bytes object and destroy the old one if it has refcount > 1.
Diffstat (limited to 'Modules/_testcapimodule.c')
-rw-r--r-- | Modules/_testcapimodule.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c index 16b5e1d..3c30381 100644 --- a/Modules/_testcapimodule.c +++ b/Modules/_testcapimodule.c @@ -3971,6 +3971,9 @@ PyInit__testcapi(void) if (_PyTestCapi_Init_Abstract(m) < 0) { return NULL; } + if (_PyTestCapi_Init_Bytes(m) < 0) { + return NULL; + } if (_PyTestCapi_Init_Unicode(m) < 0) { return NULL; } |