summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_memoryview.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-09-01 21:14:16 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-09-01 21:14:16 (GMT)
commite0793ba99293ac9df5e7e27d3f78cfc27113b359 (patch)
tree105cd42e802738644ef74b2963f25a2e2ec2d72b /Lib/test/test_memoryview.py
parent6cb5ad035b0eac63fc434c8b9625d28e2f336433 (diff)
downloadcpython-e0793ba99293ac9df5e7e27d3f78cfc27113b359.zip
cpython-e0793ba99293ac9df5e7e27d3f78cfc27113b359.tar.gz
cpython-e0793ba99293ac9df5e7e27d3f78cfc27113b359.tar.bz2
Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
Diffstat (limited to 'Lib/test/test_memoryview.py')
-rw-r--r--Lib/test/test_memoryview.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_memoryview.py b/Lib/test/test_memoryview.py
index 6ca23fc..8e56df9 100644
--- a/Lib/test/test_memoryview.py
+++ b/Lib/test/test_memoryview.py
@@ -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))