diff options
author | Stefan Krah <skrah@bytereef.org> | 2015-02-03 20:43:23 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2015-02-03 20:43:23 (GMT) |
commit | 650c1e818d7bbb5d51501051fca773b3b8ea6bf3 (patch) | |
tree | 5fdc035e52a060552f90293c04f8df9537e86def /Lib | |
parent | 38c30e6c8e34241a1ea226fdd4ff74be6a8ee846 (diff) | |
download | cpython-650c1e818d7bbb5d51501051fca773b3b8ea6bf3.zip cpython-650c1e818d7bbb5d51501051fca773b3b8ea6bf3.tar.gz cpython-650c1e818d7bbb5d51501051fca773b3b8ea6bf3.tar.bz2 |
Issue #14203: Remove obsolete support for view==NULL in bytesiobuf_getbuffer()
and array_buffer_getbuf().
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_array.py | 5 | ||||
-rw-r--r-- | Lib/test/test_bytes.py | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index adb0fd3..10d9946 100644 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -1041,6 +1041,11 @@ class BaseTest: a = array.array(self.typecode, "foo") a = array.array(self.typecode, array.array('u', 'foo')) + @support.cpython_only + def test_obsolete_write_lock(self): + from _testcapi import getbuffer_with_null_view + a = array.array('B', b"") + self.assertRaises(BufferError, getbuffer_with_null_view, a) class StringTest(BaseTest): diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index a66a982..a9f64a0 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -1224,6 +1224,10 @@ class ByteArrayTest(BaseBytesTest, unittest.TestCase): self.assertRaises(BufferError, delslice) self.assertEqual(b, orig) + @test.support.cpython_only + def test_obsolete_write_lock(self): + from _testcapi import getbuffer_with_null_view + self.assertRaises(BufferError, getbuffer_with_null_view, bytearray()) class AssortedBytesTest(unittest.TestCase): # |