diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-03-05 17:45:17 +0100 |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-03-05 17:45:17 +0100 |
commit | 1649c1b33a1d8f46ccf97b8373f62a22bbb3fde6 (patch) | |
tree | 36e4da0291c5bd73fbe2aa5b077ff10b30d07651 /Lib/test/test_buffer.py | |
parent | bf6c7eca43d7c7d80525c97af08aef52ec81e4a1 (diff) | |
download | cpython-git-1649c1b33a1d8f46ccf97b8373f62a22bbb3fde6.tar.gz |
Issue #14181: Preserve backwards compatibility for getbufferprocs that a) do
not adhere to the new documentation and b) manage to clobber view->obj before
returning failure.
Diffstat (limited to 'Lib/test/test_buffer.py')
-rw-r--r-- | Lib/test/test_buffer.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py index 533338e018..e0006f23eb 100644 --- a/Lib/test/test_buffer.py +++ b/Lib/test/test_buffer.py @@ -3609,6 +3609,12 @@ class TestBufferProtocol(unittest.TestCase): lst=lst) del x, y, z, m + def test_memoryview_getbuffer_undefined(self): + + # getbufferproc does not adhere to the new documentation + nd = ndarray([1,2,3], [3], flags=ND_GETBUF_FAIL|ND_GETBUF_UNDEFINED) + self.assertRaises(BufferError, memoryview, nd) + def test_issue_7385(self): x = ndarray([1,2,3], shape=[3], flags=ND_GETBUF_FAIL) self.assertRaises(BufferError, memoryview, x) |