@@ -2641,46 +2641,6 @@ sys__baserepl_impl(PyObject *module)
26412641 Py_RETURN_NONE ;
26422642}
26432643
2644- /*[clinic input]
2645- sys._clear_type_descriptors
2646-
2647- type: object(subclass_of='&PyType_Type')
2648- /
2649-
2650- Private function for clearing certain descriptors from a type's dictionary.
2651-
2652- See gh-135228 for context.
2653- [clinic start generated code]*/
2654-
2655- static PyObject *
2656- sys__clear_type_descriptors_impl (PyObject * module , PyObject * type )
2657- /*[clinic end generated code: output=5ad17851b762b6d9 input=dc536c97fde07251]*/
2658- {
2659- PyTypeObject * typeobj = (PyTypeObject * )type ;
2660- if (_PyType_HasFeature (typeobj , Py_TPFLAGS_IMMUTABLETYPE )) {
2661- PyErr_SetString (PyExc_TypeError , "argument is immutable" );
2662- return NULL ;
2663- }
2664- PyObject * dict = _PyType_GetDict (typeobj );
2665- PyObject * dunder_dict = NULL ;
2666- if (PyDict_Pop (dict , & _Py_ID (__dict__ ), & dunder_dict ) < 0 ) {
2667- return NULL ;
2668- }
2669- PyObject * dunder_weakref = NULL ;
2670- if (PyDict_Pop (dict , & _Py_ID (__weakref__ ), & dunder_weakref ) < 0 ) {
2671- PyType_Modified (typeobj );
2672- Py_XDECREF (dunder_dict );
2673- return NULL ;
2674- }
2675- PyType_Modified (typeobj );
2676- // We try to hold onto a reference to these until after we call
2677- // PyType_Modified(), in case their deallocation triggers somer user code
2678- // that tries to do something to the type.
2679- Py_XDECREF (dunder_dict );
2680- Py_XDECREF (dunder_weakref );
2681- Py_RETURN_NONE ;
2682- }
2683-
26842644
26852645/*[clinic input]
26862646sys._is_gil_enabled -> bool
@@ -2878,7 +2838,6 @@ static PyMethodDef sys_methods[] = {
28782838 SYS__STATS_DUMP_METHODDEF
28792839#endif
28802840 SYS__GET_CPU_COUNT_CONFIG_METHODDEF
2881- SYS__CLEAR_TYPE_DESCRIPTORS_METHODDEF
28822841 SYS__IS_GIL_ENABLED_METHODDEF
28832842 SYS__DUMP_TRACELETS_METHODDEF
28842843 {NULL, NULL} // sentinel
0 commit comments