mirror of
https://github.com/python/cpython.git
synced 2025-08-23 18:24:46 +00:00
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.
This commit is contained in:
parent
bf6c7eca43
commit
1649c1b33a
3 changed files with 23 additions and 16 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue