Issue #9737: Fix a crash when trying to delete a slice or an item from

a memoryview object.
This commit is contained in:
Antoine Pitrou 2010-09-01 21:14:16 +00:00
parent 6cb5ad035b
commit e0793ba992
3 changed files with 17 additions and 0 deletions

View file

@ -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))