Commits

wlav committed 3129f9b

fixups for CINT backend after last cleanup

Comments (0)

Files changed (2)

pypy/module/cppyy/capi/cint_capi.py

     # 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()
 
 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)

pypy/module/cppyy/test/test_cint.py

         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
         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"""