summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2012-03-05 09:45:31 (GMT)
committerStefan Krah <skrah@bytereef.org>2012-03-05 09:45:31 (GMT)
commitfcbb4169b982ce06c5701ad18898084dfa569598 (patch)
tree31a749f6636b78436986fd03352ca880c036883c /Lib
parent4e99a315b7d10049a16fb1529d2976f13dae5b71 (diff)
downloadcpython-fcbb4169b982ce06c5701ad18898084dfa569598.zip
cpython-fcbb4169b982ce06c5701ad18898084dfa569598.tar.gz
cpython-fcbb4169b982ce06c5701ad18898084dfa569598.tar.bz2
Issue #10181: The decision was to raise a buffer error in memory_exit()
if the view has exported buffers. Make this official by uncommenting a test case.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_buffer.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_buffer.py b/Lib/test/test_buffer.py
index e532460..8a8d55d 100644
--- a/Lib/test/test_buffer.py
+++ b/Lib/test/test_buffer.py
@@ -3484,11 +3484,12 @@ class TestBufferProtocol(unittest.TestCase):
self.assertEqual(m3[2], ord(b'3'))
del m1, m2, m3
- # XXX If m1 has exports, raise BufferError.
- # x = bytearray(b'123')
- # with memoryview(x) as m1:
- # ex = ndarray(m1)
- # m1[0] == ord(b'1')
+ # memoryview.release() fails if the view has exported buffers.
+ x = bytearray(b'123')
+ with self.assertRaises(BufferError):
+ with memoryview(x) as m:
+ ex = ndarray(m)
+ m[0] == ord(b'1')
def test_memoryview_redirect(self):