@@ -863,7 +863,7 @@ type_repr(PyTypeObject *type)
863863 return NULL ;
864864 }
865865
866- if (mod != NULL && _PyUnicode_CompareWithId (mod , & PyId_builtins ))
866+ if (mod != NULL && ! _PyUnicode_EqualToASCIIId (mod , & PyId_builtins ))
867867 rtn = PyUnicode_FromFormat ("<class '%U.%U'>" , mod , name );
868868 else
869869 rtn = PyUnicode_FromFormat ("<class '%s'>" , type -> tp_name );
@@ -2403,7 +2403,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
24032403 if (!valid_identifier (tmp ))
24042404 goto error ;
24052405 assert (PyUnicode_Check (tmp ));
2406- if (_PyUnicode_CompareWithId (tmp , & PyId___dict__ ) == 0 ) {
2406+ if (_PyUnicode_EqualToASCIIId (tmp , & PyId___dict__ )) {
24072407 if (!may_add_dict || add_dict ) {
24082408 PyErr_SetString (PyExc_TypeError ,
24092409 "__dict__ slot disallowed: "
@@ -2434,7 +2434,7 @@ type_new(PyTypeObject *metatype, PyObject *args, PyObject *kwds)
24342434 for (i = j = 0 ; i < nslots ; i ++ ) {
24352435 tmp = PyTuple_GET_ITEM (slots , i );
24362436 if ((add_dict &&
2437- _PyUnicode_CompareWithId (tmp , & PyId___dict__ ) == 0 ) ||
2437+ _PyUnicode_EqualToASCIIId (tmp , & PyId___dict__ )) ||
24382438 (add_weak &&
24392439 _PyUnicode_EqualToASCIIString (tmp , "__weakref__" )))
24402440 continue ;
@@ -3538,7 +3538,7 @@ object_repr(PyObject *self)
35383538 Py_XDECREF (mod );
35393539 return NULL ;
35403540 }
3541- if (mod != NULL && _PyUnicode_CompareWithId (mod , & PyId_builtins ))
3541+ if (mod != NULL && ! _PyUnicode_EqualToASCIIId (mod , & PyId_builtins ))
35423542 rtn = PyUnicode_FromFormat ("<%U.%U object at %p>" , mod , name , self );
35433543 else
35443544 rtn = PyUnicode_FromFormat ("<%s object at %p>" ,
@@ -7238,7 +7238,7 @@ super_getattro(PyObject *self, PyObject *name)
72387238 (i.e. super, or a subclass), not the class of su->obj. */
72397239 if (PyUnicode_Check (name ) &&
72407240 PyUnicode_GET_LENGTH (name ) == 9 &&
7241- _PyUnicode_CompareWithId (name , & PyId___class__ ) == 0 )
7241+ _PyUnicode_EqualToASCIIId (name , & PyId___class__ ))
72427242 goto skip ;
72437243
72447244 mro = starttype -> tp_mro ;
@@ -7450,7 +7450,7 @@ super_init(PyObject *self, PyObject *args, PyObject *kwds)
74507450 for (i = 0 ; i < n ; i ++ ) {
74517451 PyObject * name = PyTuple_GET_ITEM (co -> co_freevars , i );
74527452 assert (PyUnicode_Check (name ));
7453- if (! _PyUnicode_CompareWithId (name , & PyId___class__ )) {
7453+ if (_PyUnicode_EqualToASCIIId (name , & PyId___class__ )) {
74547454 Py_ssize_t index = co -> co_nlocals +
74557455 PyTuple_GET_SIZE (co -> co_cellvars ) + i ;
74567456 PyObject * cell = f -> f_localsplus [index ];
0 commit comments