Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r70987:154db8349f24
Date: 2014-04-25 13:32 -0700
http://bitbucket.org/pypy/pypy/changeset/154db8349f24/
Log: use getarg_w instead of readbuf_w (thanks Brian!)
diff --git a/pypy/module/cppyy/converter.py b/pypy/module/cppyy/converter.py
--- a/pypy/module/cppyy/converter.py
+++ b/pypy/module/cppyy/converter.py
@@ -63,7 +63,7 @@
def get_rawbuffer(space, w_obj):
# raw buffer
try:
- buf = space.readbuf_w(w_obj)
+ buf = space.getarg_w('s*', w_obj)
return rffi.cast(rffi.VOIDP, buf.get_raw_address())
except Exception:
pass
@@ -163,7 +163,7 @@
def to_memory(self, space, w_obj, w_value, offset):
# copy the full array (uses byte copy for now)
address = rffi.cast(rffi.CCHARP, self._get_raw_address(space, w_obj,
offset))
- buf = space.readbuf_w(w_value)
+ buf = space.getarg_w('s*', w_value)
# TODO: report if too many items given?
for i in range(min(self.size*self.typesize, buf.getlength())):
address[i] = buf.getitem(i)
@@ -204,7 +204,7 @@
# copy only the pointer value
rawobject = get_rawobject_nonnull(space, w_obj)
byteptr = rffi.cast(rffi.CCHARPP, capi.direct_ptradd(rawobject,
offset))
- buf = space.readbuf_w(w_value)
+ buf = space.getarg_w('s*', w_value)
try:
byteptr[0] = buf.get_raw_address()
except ValueError:
diff --git a/pypy/module/cppyy/test/test_zjit.py
b/pypy/module/cppyy/test/test_zjit.py
--- a/pypy/module/cppyy/test/test_zjit.py
+++ b/pypy/module/cppyy/test/test_zjit.py
@@ -133,10 +133,7 @@
return w_obj
interp_w._annspecialcase_ = 'specialize:arg(1)'
- def buffer_w(self, w_obj, flags):
- return FakeBuffer(w_obj)
-
- def readbuf_w(self, w_obj):
+ def getarg_w(self, code, w_obj): # for retrieving buffers
return FakeBuffer(w_obj)
def exception_match(self, typ, sub):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit