@@ -858,7 +858,7 @@ type_repr(PyTypeObject *type)
858858 return NULL ;
859859 }
860860
861- if (mod != NULL && _PyUnicode_CompareWithId (mod , & PyId_builtins ))
861+ if (mod != NULL && ! _PyUnicode_EqualToASCIIId (mod , & PyId_builtins ))
862862 rtn = PyUnicode_FromFormat ("<class '%U.%U'>" , mod , name );
863863 else
864864 rtn = PyUnicode_FromFormat ("<class '%s'>" , type -> tp_name );
@@ -2386,7 +2386,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
23862386 if (!valid_identifier (tmp ))
23872387 goto error ;
23882388 assert (PyUnicode_Check (tmp ));
2389- if (_PyUnicode_CompareWithId (tmp , & PyId___dict__ ) == 0 ) {
2389+ if (_PyUnicode_EqualToASCIIId (tmp , & PyId___dict__ )) {
23902390 if (!may_add_dict || add_dict ) {
23912391 PyErr_SetString (PyExc_TypeError ,
23922392 "__dict__ slot disallowed: "
@@ -2417,7 +2417,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
24172417 for (i = j = 0 ; i < nslots ; i ++ ) {
24182418 tmp = PyTuple_GET_ITEM (slots , i );
24192419 if ((add_dict &&
2420- _PyUnicode_CompareWithId (tmp , & PyId___dict__ ) == 0 ) ||
2420+ _PyUnicode_EqualToASCIIId (tmp , & PyId___dict__ )) ||
24212421 (add_weak &&
24222422 _PyUnicode_EqualToASCIIString (tmp , "__weakref__" )))
24232423 continue ;
@@ -3490,7 +3490,7 @@ object_repr(PyObject *self)
34903490 Py_XDECREF (mod );
34913491 return NULL ;
34923492 }
3493- if (mod != NULL && _PyUnicode_CompareWithId (mod , & PyId_builtins ))
3493+ if (mod != NULL && ! _PyUnicode_EqualToASCIIId (mod , & PyId_builtins ))
34943494 rtn = PyUnicode_FromFormat ("<%U.%U object at %p>" , mod , name , self );
34953495 else
34963496 rtn = PyUnicode_FromFormat ("<%s object at %p>" ,
@@ -7107,7 +7107,7 @@ super_getattro(PyObject *self, PyObject *name)
71077107 (i.e. super, or a subclass), not the class of su->obj. */
71087108 if (PyUnicode_Check (name ) &&
71097109 PyUnicode_GET_LENGTH (name ) == 9 &&
7110- _PyUnicode_CompareWithId (name , & PyId___class__ ) == 0 )
7110+ _PyUnicode_EqualToASCIIId (name , & PyId___class__ ))
71117111 goto skip ;
71127112
71137113 mro = starttype -> tp_mro ;
@@ -7319,7 +7319,7 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
73197319 for (i = 0 ; i < n ; i ++ ) {
73207320 PyObject * name = PyTuple_GET_ITEM (co -> co_freevars , i );
73217321 assert (PyUnicode_Check (name ));
7322- if (! _PyUnicode_CompareWithId (name , & PyId___class__ )) {
7322+ if (_PyUnicode_EqualToASCIIId (name , & PyId___class__ )) {
73237323 Py_ssize_t index = co -> co_nlocals +
73247324 PyTuple_GET_SIZE (co -> co_cellvars ) + i ;
73257325 PyObject * cell = f -> f_localsplus [index ];
0 commit comments