Author: Wim Lavrijsen <[email protected]>
Branch: reflex-support
Changeset: r59760:3129f9b33e37
Date: 2013-01-05 00:15 -0800
http://bitbucket.org/pypy/pypy/changeset/3129f9b33e37/
Log: fixups for CINT backend after last cleanup
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
@@ -166,6 +166,8 @@
# setup branch as a data member and enable it for reading
space = tree.space # holds the class cache in State
w_branch = space.call_method(w_self, "GetBranch", args_w[0])
+ if not space.is_true(w_branch):
+ raise OperationError(space.w_AttributeError, args_w[0])
w_klassname = space.call_method(w_branch, "GetClassName")
klass = interp_cppyy.scope_byname(space, space.str_w(w_klassname))
w_obj = klass.construct()
@@ -178,7 +180,6 @@
class W_TTreeIter(Wrappable):
def __init__(self, space, w_tree):
-
from pypy.module.cppyy import interp_cppyy
tree = space.interp_w(interp_cppyy.W_CPPInstance, w_tree)
self.tree = tree.get_cppthis(tree.cppclass)
diff --git a/pypy/module/cppyy/test/test_cint.py
b/pypy/module/cppyy/test/test_cint.py
--- a/pypy/module/cppyy/test/test_cint.py
+++ b/pypy/module/cppyy/test/test_cint.py
@@ -41,9 +41,9 @@
oldval = cppyy.gbl.gDebug
assert oldval != 3
- proxy = cppyy.gbl.__class__.gDebug
+ proxy = cppyy.gbl.__class__.__dict__['gDebug']
cppyy.gbl.gDebug = 3
- assert proxy.__get__(proxy) == 3
+ assert proxy.__get__(proxy, None) == 3
# this is where this test differs from test03_write_access_to_globals
# in test_pythonify.py
@@ -60,8 +60,8 @@
cppyy.gbl.gROOT.ProcessLine('double gMyOwnGlobal = 3.1415')
assert cppyy.gbl.gMyOwnGlobal == 3.1415
- proxy = cppyy.gbl.__class__.gMyOwnGlobal
- assert proxy.__get__(proxy) == 3.1415
+ proxy = cppyy.gbl.__class__.__dict__['gMyOwnGlobal']
+ assert proxy.__get__(proxy, None) == 3.1415
def test04_auto_loading(self):
"""Test auto-loading by retrieving a non-preloaded class"""
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit