[pypy-commit] pypy cpyext-gc-support: fixes

arigo noreply at buildbot.pypy.org
Fri Oct 23 08:04:45 EDT 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: cpyext-gc-support
Changeset: r80408:aa3df47ed02d
Date: 2015-10-23 13:40 +0200
http://bitbucket.org/pypy/pypy/changeset/aa3df47ed02d/

Log:	fixes

diff --git a/pypy/module/cpyext/dictobject.py b/pypy/module/cpyext/dictobject.py
--- a/pypy/module/cpyext/dictobject.py
+++ b/pypy/module/cpyext/dictobject.py
@@ -35,7 +35,7 @@
 def PyDict_DelItem(space, w_dict, w_key):
     if not isinstance(w_dict, W_DictMultiObject):
         PyErr_BadInternalCall(space)
-    w_dict.delitem(w_key)
+    space.delitem(w_dict, w_key)
     return 0
 
 @cpython_api([PyObject, CONST_STRING, PyObject], rffi.INT_real, error=-1)
@@ -64,7 +64,7 @@
     if not isinstance(w_dict, W_DictMultiObject):
         PyErr_BadInternalCall(space)
     key = rffi.charp2str(key_ptr)
-    w_dict.delitem(space.wrap(key))
+    space.delitem(w_dict, space.wrap(key))
     return 0
 
 @cpython_api([PyObject], Py_ssize_t, error=-1)
diff --git a/pypy/module/cpyext/test/test_dictobject.py b/pypy/module/cpyext/test/test_dictobject.py
--- a/pypy/module/cpyext/test/test_dictobject.py
+++ b/pypy/module/cpyext/test/test_dictobject.py
@@ -9,8 +9,9 @@
         d = api.PyDict_New()
         assert space.eq_w(d, space.newdict())
 
-        assert space.eq_w(api.PyDict_GetItem(space.wrap({"a": 72}),
-                                             space.wrap("a")),
+        assert space.eq_w(from_pyobj(space,
+                                     api.PyDict_GetItem(space.wrap({"a": 72}),
+                                                        space.wrap("a"))),
                           space.wrap(72))
 
         assert api.PyDict_SetItem(d, space.wrap("c"), space.wrap(42)) >= 0
@@ -18,7 +19,8 @@
                           space.wrap(42))
 
         space.setitem(d, space.wrap("name"), space.wrap(3))
-        assert space.eq_w(api.PyDict_GetItem(d, space.wrap("name")),
+        assert space.eq_w(from_pyobj(space,
+                                     api.PyDict_GetItem(d, space.wrap("name"))),
                           space.wrap(3))
 
         space.delitem(d, space.wrap("name"))


More information about the pypy-commit mailing list