summaryrefslogtreecommitdiff
path: root/Lib/test/test_buffer.py
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-03-05 17:45:17 +0100
committerStefan Krah <skrah@bytereef.org>2012-03-05 17:45:17 +0100
commit1649c1b33a1d8f46ccf97b8373f62a22bbb3fde6 (patch)
tree36e4da0291c5bd73fbe2aa5b077ff10b30d07651 /Lib/test/test_buffer.py
parentbf6c7eca43d7c7d80525c97af08aef52ec81e4a1 (diff)
downloadcpython-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.py6
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)