Author: Ronan Lamy <[email protected]>
Branch: PyBuffer
Changeset: r91103:08c44d310db7
Date: 2017-04-20 17:46 +0100
http://bitbucket.org/pypy/pypy/changeset/08c44d310db7/
Log: Replace getarg_w() with writebuf_w() where appropriate
diff --git a/pypy/module/_io/interp_bufferedio.py
b/pypy/module/_io/interp_bufferedio.py
--- a/pypy/module/_io/interp_bufferedio.py
+++ b/pypy/module/_io/interp_bufferedio.py
@@ -117,7 +117,7 @@
return self._readinto(space, w_buffer, "read1")
def _readinto(self, space, w_buffer, methodname):
- rwbuffer = space.getarg_w('w*', w_buffer)
+ rwbuffer = space.writebuf_w(w_buffer)
length = rwbuffer.getlength()
w_data = space.call_method(self, methodname, space.newint(length))
diff --git a/pypy/module/_io/interp_bytesio.py
b/pypy/module/_io/interp_bytesio.py
--- a/pypy/module/_io/interp_bytesio.py
+++ b/pypy/module/_io/interp_bytesio.py
@@ -88,7 +88,7 @@
def readinto_w(self, space, w_buffer):
self._check_closed(space)
- rwbuffer = space.getarg_w('w*', w_buffer)
+ rwbuffer = space.writebuf_w(w_buffer)
size = rwbuffer.getlength()
output = self.read(size)
diff --git a/pypy/module/_io/interp_fileio.py b/pypy/module/_io/interp_fileio.py
--- a/pypy/module/_io/interp_fileio.py
+++ b/pypy/module/_io/interp_fileio.py
@@ -449,7 +449,7 @@
def readinto_w(self, space, w_buffer):
self._check_closed(space)
self._check_readable(space)
- rwbuffer = space.getarg_w('w*', w_buffer)
+ rwbuffer = space.writebuf_w(w_buffer)
length = rwbuffer.getlength()
target_address = lltype.nullptr(rffi.CCHARP.TO)
diff --git a/pypy/module/_socket/interp_socket.py
b/pypy/module/_socket/interp_socket.py
--- a/pypy/module/_socket/interp_socket.py
+++ b/pypy/module/_socket/interp_socket.py
@@ -559,7 +559,7 @@
See recv() for documentation about the flags.
"""
- rwbuffer = space.getarg_w('w*', w_buffer)
+ rwbuffer = space.writebuf_w(w_buffer)
lgt = rwbuffer.getlength()
if nbytes < 0:
raise oefmt(space.w_ValueError, "negative buffersize in recv_into")
@@ -581,7 +581,7 @@
Like recv_into(buffer[, nbytes[, flags]]) but also return the sender's
address info.
"""
- rwbuffer = space.getarg_w('w*', w_buffer)
+ rwbuffer = space.writebuf_w(w_buffer)
lgt = rwbuffer.getlength()
if nbytes == 0:
nbytes = lgt
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
@@ -85,7 +85,7 @@
Write the packed bytes into the writable buffer buf starting at offset
"""
res = _pack(space, format, args_w)
- buf = space.getarg_w('w*', w_buffer)
+ buf = space.writebuf_w(w_buffer)
if offset < 0:
offset += buf.getlength()
size = len(res)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit