Author: Matti Picus <[email protected]>
Branch:
Changeset: r96152:b7859ce44de0
Date: 2019-02-25 08:23 +0200
http://bitbucket.org/pypy/pypy/changeset/b7859ce44de0/
Log: fix return values
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
@@ -73,7 +73,7 @@
result_borrowed=True)
def PyDict_GetItem(space, w_dict, w_key):
if not isinstance(w_dict, W_DictMultiObject):
- raise PyErr_BadInternalCall(space)
+ return None
# NOTE: this works so far because all our dict strategies store
# *values* as full objects, which stay alive as long as the dict is
# alive and not modified. So we can return a borrowed ref.
@@ -83,14 +83,14 @@
@cpython_api([PyObject, PyObject, PyObject], rffi.INT_real, error=-1)
def PyDict_SetItem(space, w_dict, w_key, w_obj):
if not isinstance(w_dict, W_DictMultiObject):
- raise PyErr_BadInternalCall(space)
+ PyErr_BadInternalCall(space)
w_dict.setitem(w_key, w_obj)
return 0
@cpython_api([PyObject, PyObject], rffi.INT_real, error=-1)
def PyDict_DelItem(space, w_dict, w_key):
if not isinstance(w_dict, W_DictMultiObject):
- raise PyErr_BadInternalCall(space)
+ PyErr_BadInternalCall(space)
w_dict.descr_delitem(space, w_key)
return 0
@@ -98,7 +98,7 @@
def PyDict_SetItemString(space, w_dict, key_ptr, w_obj):
w_key = space.newtext(rffi.charp2str(key_ptr))
if not isinstance(w_dict, W_DictMultiObject):
- raise PyErr_BadInternalCall(space)
+ PyErr_BadInternalCall(space)
w_dict.setitem(w_key, w_obj)
return 0
@@ -109,7 +109,7 @@
char*, rather than a PyObject*."""
w_key = space.newtext(rffi.charp2str(key))
if not isinstance(w_dict, W_DictMultiObject):
- raise PyErr_BadInternalCall(space)
+ return None
# NOTE: this works so far because all our dict strategies store
# *values* as full objects, which stay alive as long as the dict is
# alive and not modified. So we can return a borrowed ref.
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit