summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-01-05 10:52:38 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-01-05 10:52:38 (GMT)
commitf63438ad81bc41a2bece664610c0e04608d19a0b (patch)
tree97911cee140d2d06c7c72f14074d239a1d0ea9e5 /Objects
parent99dc4093428735e01646bcced69de327f4f11e51 (diff)
downloadcpython-f63438ad81bc41a2bece664610c0e04608d19a0b.zip
cpython-f63438ad81bc41a2bece664610c0e04608d19a0b.tar.gz
cpython-f63438ad81bc41a2bece664610c0e04608d19a0b.tar.bz2
Implement PyObject_DelItemString. Fixes #498915.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/abstract.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 5931449..2acfd08 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -174,6 +174,24 @@ PyObject_DelItem(PyObject *o, PyObject *key)
return -1;
}
+int
+PyObject_DelItemString(PyObject *o, char *key)
+{
+ PyObject *okey;
+ int ret;
+
+ if (o == NULL || key == NULL) {
+ null_error();
+ return -1;
+ }
+ okey = PyString_FromString(key);
+ if (okey == NULL)
+ return -1;
+ ret = PyObject_DelItem(o, okey);
+ Py_DECREF(okey);
+ return ret;
+}
+
int PyObject_AsCharBuffer(PyObject *obj,
const char **buffer,
int *buffer_len)