File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -445,6 +445,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
445
445
statement: o[key]=v.
446
446
*/
447
447
448
+ DL_IMPORT (int ) PyObject_DelItemString (PyObject * o , char * key );
449
+
450
+ /*
451
+ Remove the mapping for object, key, from the object *o.
452
+ Returns -1 on failure. This is equivalent to
453
+ the Python statement: del o[key].
454
+ */
455
+
448
456
DL_IMPORT (int ) PyObject_DelItem (PyObject * o , PyObject * key );
449
457
450
458
/*
Original file line number Diff line number Diff line change @@ -174,6 +174,24 @@ PyObject_DelItem(PyObject *o, PyObject *key)
174
174
return -1 ;
175
175
}
176
176
177
+ int
178
+ PyObject_DelItemString (PyObject * o , char * key )
179
+ {
180
+ PyObject * okey ;
181
+ int ret ;
182
+
183
+ if (o == NULL || key == NULL ) {
184
+ null_error ();
185
+ return -1 ;
186
+ }
187
+ okey = PyString_FromString (key );
188
+ if (okey == NULL )
189
+ return -1 ;
190
+ ret = PyObject_DelItem (o , okey );
191
+ Py_DECREF (okey );
192
+ return ret ;
193
+ }
194
+
177
195
int PyObject_AsCharBuffer (PyObject * obj ,
178
196
const char * * buffer ,
179
197
int * buffer_len )
You can’t perform that action at this time.
0 commit comments