File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2661,17 +2661,17 @@ sys__clear_type_descriptors(PyObject *module, PyObject *type)
26612661 return NULL ;
26622662 }
26632663 PyTypeObject * typeobj = (PyTypeObject * )(type );
2664- if (!_PyType_HasFeature (typeobj , Py_TPFLAGS_HEAPTYPE )) {
2665- PyErr_SetString (PyExc_TypeError , "argument must be a heap type " );
2664+ if (!_PyType_HasFeature (typeobj , Py_TPFLAGS_IMMUTABLETYPE )) {
2665+ PyErr_SetString (PyExc_TypeError , "argument is immutable " );
26662666 return NULL ;
26672667 }
26682668 PyObject * dict = _PyType_GetDict (typeobj );
26692669 PyObject * dunder_dict = NULL ;
2670- if (PyDict_PopString (dict , " __dict__" , & dunder_dict ) < 0 ) {
2670+ if (PyDict_Pop (dict , & _Py_ID ( __dict__ ) , & dunder_dict ) < 0 ) {
26712671 return NULL ;
26722672 }
26732673 PyObject * dunder_weakref = NULL ;
2674- if (PyDict_PopString (dict , " __weakref__" , & dunder_weakref ) < 0 ) {
2674+ if (PyDict_Pop (dict , & _Py_ID ( __weakref__ ) , & dunder_weakref ) < 0 ) {
26752675 PyType_Modified (typeobj );
26762676 Py_XDECREF (dunder_dict );
26772677 return NULL ;
You can’t perform that action at this time.
0 commit comments