[pypy-commit] pypy PyBuffer: fixes
rlamy
pypy.commits at gmail.com
Thu Apr 27 13:24:45 EDT 2017
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: PyBuffer
Changeset: r91141:b3701341d1aa
Date: 2017-04-27 17:57 +0100
http://bitbucket.org/pypy/pypy/changeset/b3701341d1aa/
Log: fixes
diff --git a/pypy/module/__pypy__/bytebuffer.py b/pypy/module/__pypy__/bytebuffer.py
--- a/pypy/module/__pypy__/bytebuffer.py
+++ b/pypy/module/__pypy__/bytebuffer.py
@@ -2,7 +2,9 @@
# A convenient read-write buffer. Located here for want of a better place.
#
-from pypy.interpreter.buffer import SimpleView, ByteBuffer
+from rpython.rlib.buffer import ByteBuffer
+
+from pypy.interpreter.buffer import SimpleView
from pypy.interpreter.gateway import unwrap_spec
@unwrap_spec(length=int)
diff --git a/pypy/module/struct/interp_struct.py b/pypy/module/struct/interp_struct.py
--- a/pypy/module/struct/interp_struct.py
+++ b/pypy/module/struct/interp_struct.py
@@ -127,7 +127,7 @@
"""Unpack the buffer, containing packed C structure data, according to
fmt, starting at offset. Requires len(buffer[offset:]) >= calcsize(fmt)."""
size = _calcsize(space, format)
- buf = space.readbuf_w(w_buffer, space.BUF_SIMPLE)
+ buf = space.readbuf_w(w_buffer)
if offset < 0:
offset += buf.getlength()
if offset < 0 or (buf.getlength() - offset) < size:
@@ -140,7 +140,7 @@
class W_UnpackIter(W_Root):
def __init__(self, space, w_struct, w_buffer):
- buf = space.readbuf_w(w_buffer, space.BUF_SIMPLE)
+ buf = space.readbuf_w(w_buffer)
if w_struct.size <= 0:
raise oefmt(get_error(space),
"cannot iteratively unpack with a struct of length %d",
More information about the pypy-commit
mailing list