[pypy-commit] pypy space-newtext: a number of wraps in cppyy (untested)
cfbolz
pypy.commits at gmail.com
Tue Nov 22 07:46:22 EST 2016
Author: Carl Friedrich Bolz <cfbolz at gmx.de>
Branch: space-newtext
Changeset: r88544:24290f1e845d
Date: 2016-11-21 13:06 +0100
http://bitbucket.org/pypy/pypy/changeset/24290f1e845d/
Log: a number of wraps in cppyy (untested)
diff --git a/pypy/module/cppyy/capi/cint_capi.py b/pypy/module/cppyy/capi/cint_capi.py
--- a/pypy/module/cppyy/capi/cint_capi.py
+++ b/pypy/module/cppyy/capi/cint_capi.py
@@ -329,7 +329,7 @@
cdata = cdataobj.W_CData(space, address, newtype.new_primitive_type(space, typename))
# cache result
- space.setattr(w_self, space.newtext('_'+attr), space.wrap(cdata))
+ space.setattr(w_self, space.newtext('_'+attr), cdata)
return space.getattr(w_self, args_w[0])
class W_TTreeIter(W_Root):
@@ -346,7 +346,7 @@
space.call_method(w_tree, "SetBranchStatus", space.newtext("*"), space.newint(0))
def iter_w(self):
- return self.space.wrap(self)
+ return self
def next_w(self):
if self.current == self.maxentry:
@@ -383,11 +383,11 @@
]
for f in allfuncs:
- _pythonizations[f.__name__] = space.wrap(interp2app(f))
+ _pythonizations[f.__name__] = interp2app(f).spacebind(space)
def _method_alias(space, w_pycppclass, m1, m2):
- space.setattr(w_pycppclass, space.wrap(m1),
- space.getattr(w_pycppclass, space.wrap(m2)))
+ space.setattr(w_pycppclass, space.newtext(m1),
+ space.getattr(w_pycppclass, space.newtext(m2)))
# callback coming in when app-level bound classes have been created
def pythonize(space, name, w_pycppclass):
diff --git a/pypy/module/cppyy/interp_cppyy.py b/pypy/module/cppyy/interp_cppyy.py
--- a/pypy/module/cppyy/interp_cppyy.py
+++ b/pypy/module/cppyy/interp_cppyy.py
@@ -60,7 +60,7 @@
nullarr = arr.fromaddress(space, rffi.cast(rffi.ULONG, 0), 0)
assert isinstance(nullarr, W_ArrayInstance)
nullarr.free(space)
- state.w_nullptr = space.wrap(nullarr)
+ state.w_nullptr = nullarr
return state.w_nullptr
@unwrap_spec(name=str)
@@ -1069,7 +1069,7 @@
def _get_as_builtin(self):
try:
- return self.space.call_method(self.space.wrap(self), "_cppyy_as_builtin")
+ return self.space.call_method(self, "_cppyy_as_builtin")
except OperationError as e:
if not (e.match(self.space, self.space.w_TypeError) or
e.match(self.space, self.space.w_AttributeError)):
More information about the pypy-commit
mailing list