mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
This commit is contained in:
parent
6cb5ad035b
commit
e0793ba992
3 changed files with 17 additions and 0 deletions
|
@ -111,6 +111,15 @@ class AbstractMemoryTests:
|
|||
m = None
|
||||
self.assertEquals(sys.getrefcount(b), oldrefcount)
|
||||
|
||||
def test_delitem(self):
|
||||
for tp in self._types:
|
||||
b = tp(self._source)
|
||||
m = self._view(b)
|
||||
with self.assertRaises(TypeError):
|
||||
del m[1]
|
||||
with self.assertRaises(TypeError):
|
||||
del m[1:4]
|
||||
|
||||
def test_tobytes(self):
|
||||
for tp in self._types:
|
||||
m = self._view(tp(self._source))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue