Author: Philip Jenvey <[email protected]>
Branch: py3k
Changeset: r70271:a0706792c660
Date: 2014-03-24 16:36 -0700
http://bitbucket.org/pypy/pypy/changeset/a0706792c660/
Log: py3k still needs _check_released in buffer_w
diff --git a/pypy/objspace/std/memoryview.py b/pypy/objspace/std/memoryview.py
--- a/pypy/objspace/std/memoryview.py
+++ b/pypy/objspace/std/memoryview.py
@@ -49,6 +49,7 @@
consistency, in PyPy memoryview DOES support buffer(), which means
that it is accepted in more places than CPython.
"""
+ self._check_released(space)
return self.buf
@staticmethod
diff --git a/pypy/objspace/std/test/test_memoryview.py
b/pypy/objspace/std/test/test_memoryview.py
--- a/pypy/objspace/std/test/test_memoryview.py
+++ b/pypy/objspace/std/test/test_memoryview.py
@@ -116,4 +116,5 @@
v = memoryview(b"a"*100)
with v as cm:
assert cm is v
+ raises(ValueError, bytes, v)
assert "released memory" in repr(v)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit