summaryrefslogtreecommitdiff
path: root/lang/python27/files
diff options
context:
space:
mode:
authorThomas Gellekum <tg@FreeBSD.org>2002-01-16 12:22:20 +0000
committerThomas Gellekum <tg@FreeBSD.org>2002-01-16 12:22:20 +0000
commit7d4762e8bb84698e8e04f9ee26904d79ab09f783 (patch)
tree222de11876b4a0d32163fadcc236dbb98f40759b /lang/python27/files
parent* Do not clobber plaintext manual if WITH_MUTT_HTML is undefined. (diff)
Implement PyObject_DelItemString(), which was obviously forgotten for
Python-2.2. This will fix at least the metakit port. Bump PORTREVISION. Obtained from: Python CVS tree
Notes
Notes: svn path=/head/; revision=53162
Diffstat (limited to 'lang/python27/files')
-rw-r--r--lang/python27/files/patch-PyObject_DelItemString56
1 files changed, 56 insertions, 0 deletions
diff --git a/lang/python27/files/patch-PyObject_DelItemString b/lang/python27/files/patch-PyObject_DelItemString
new file mode 100644
index 000000000000..4f81f9e521b8
--- /dev/null
+++ b/lang/python27/files/patch-PyObject_DelItemString
@@ -0,0 +1,56 @@
+Index: Include/abstract.h
+===================================================================
+RCS file: /home/python/cvs/python/dist/src/Include/abstract.h,v
+retrieving revision 2.42
+retrieving revision 2.43
+diff -u -r2.42 -r2.43
+--- Include/abstract.h 28 Nov 2001 16:20:07 -0000 2.42
++++ Include/abstract.h 5 Jan 2002 10:50:30 -0000 2.43
+@@ -445,6 +445,14 @@
+ statement: o[key]=v.
+ */
+
++ DL_IMPORT(int) PyObject_DelItemString(PyObject *o, char *key);
++
++ /*
++ Remove the mapping for object, key, from the object *o.
++ Returns -1 on failure. This is equivalent to
++ the Python statement: del o[key].
++ */
++
+ DL_IMPORT(int) PyObject_DelItem(PyObject *o, PyObject *key);
+
+ /*
+Index: Objects/abstract.c
+===================================================================
+RCS file: /home/python/cvs/python/dist/src/Objects/abstract.c,v
+retrieving revision 2.93
+retrieving revision 2.94
+diff -u -r2.93 -r2.94
+--- Objects/abstract.c 24 Nov 2001 18:24:47 -0000 2.93
++++ Objects/abstract.c 5 Jan 2002 10:50:30 -0000 2.94
+@@ -174,6 +174,24 @@
+ 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)