@@ -15,7 +15,9 @@ static PyObject *update_id_unicode = NULL;
1515static PyObject * keys_id_unicode = NULL ;
1616static PyObject * values_id_unicode = NULL ;
1717static PyObject * items_id_unicode = NULL ;
18- // clear_id_unicode and copy_id_unicode are shared with list_ops, declared in misc_ops.c
18+ // dict_ prefix prevents a name conflict with list_ops
19+ static PyObject * dict_copy_id_unicode = NULL ;
20+ static PyObject * dict_clear_id_unicode = NULL ;
1921
2022// Dict subclasses like defaultdict override things in interesting
2123// ways, so we don't want to just directly use the dict methods. Not
@@ -336,14 +338,14 @@ char CPyDict_Clear(PyObject *dict) {
336338 if (PyDict_CheckExact (dict )) {
337339 PyDict_Clear (dict );
338340 } else {
339- if (clear_id_unicode == NULL ) {
341+ if (dict_clear_id_unicode == NULL ) {
340342 _Py_IDENTIFIER (clear );
341- clear_id_unicode = _PyUnicode_FromId (& PyId_clear ); /* borrowed */
342- if (clear_id_unicode == NULL ) {
343+ dict_clear_id_unicode = _PyUnicode_FromId (& PyId_clear ); /* borrowed */
344+ if (dict_clear_id_unicode == NULL ) {
343345 return 0 ;
344346 }
345347 }
346- PyObject * res = PyObject_CallMethodNoArgs (dict , clear_id_unicode );
348+ PyObject * res = PyObject_CallMethodNoArgs (dict , dict_clear_id_unicode );
347349 if (res == NULL ) {
348350 return 0 ;
349351 }
@@ -355,14 +357,14 @@ PyObject *CPyDict_Copy(PyObject *dict) {
355357 if (PyDict_CheckExact (dict )) {
356358 return PyDict_Copy (dict );
357359 }
358- if (copy_id_unicode == NULL ) {
360+ if (dict_copy_id_unicode == NULL ) {
359361 _Py_IDENTIFIER (copy );
360- copy_id_unicode = _PyUnicode_FromId (& PyId_copy ); /* borrowed */
361- if (copy_id_unicode == NULL ) {
362+ dict_copy_id_unicode = _PyUnicode_FromId (& PyId_copy ); /* borrowed */
363+ if (dict_copy_id_unicode == NULL ) {
362364 return NULL ;
363365 }
364366 }
365- return PyObject_CallMethodNoArgs (dict , copy_id_unicode );
367+ return PyObject_CallMethodNoArgs (dict , dict_copy_id_unicode );
366368}
367369
368370PyObject * CPyDict_GetKeysIter (PyObject * dict ) {
0 commit comments