File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1872,6 +1872,8 @@ def test_repeat_after_setslice(self):
1872
1872
self .assertEqual (b3 , b'xcxcxc' )
1873
1873
1874
1874
def test_mutating_index (self ):
1875
+ # bytearray slice assignment can call into python code
1876
+ # that reallocates the internal buffer
<
8D27
tr class="diff-line-row">1875
1877
# See gh-91153
1876
1878
1877
1879
class Boom :
@@ -1890,10 +1892,10 @@ def __index__(self):
1890
1892
self ._testlimitedcapi .sequence_setitem (b , 0 , Boom ())
1891
1893
1892
1894
def test_mutating_index_inbounds (self ):
1893
- # See gh-91153
1895
+ # gh-91153 continued
1896
+ # Ensure buffer is not broken even if length is correct
1894
1897
1895
1898
class MutatesOnIndex :
1896
-
1897
1899
def __init__ (self ):
1898
1900
self .ba = bytearray (0x180 )
1899
1901
You can’t perform that action at this time.
0 commit comments