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.
This commit is contained in:
Serhiy Storchaka 2024-03-25 17:32:11 +02:00 committed by GitHub
parent 01e7405da4
commit 0c1a42cf9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 123 additions and 30 deletions

View file

@ -0,0 +1,3 @@
:c:func:`_PyBytes_Resize` can now be called for bytes objects with reference
count > 1, including 1-byte bytes objects. It creates a new bytes object and
destroys the old one if it has reference count > 1.