@@ -2641,46 +2641,6 @@ sys__baserepl_impl(PyObject *module)
2641
2641
Py_RETURN_NONE ;
2642
2642
}
2643
2643
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
-
2684
2644
2685
2645
/*[clinic input]
2686
2646
sys._is_gil_enabled -> bool
@@ -2878,7 +2838,6 @@ static PyMethodDef sys_methods[] = {
2878
2838
SYS__STATS_DUMP_METHODDEF
2879
2839
#endif
2880
2840
SYS__GET_CPU_COUNT_CONFIG_METHODDEF
2881
- SYS__CLEAR_TYPE_DESCRIPTORS_METHODDEF
2882
2841
SYS__IS_GIL_ENABLED_METHODDEF
2883
2842
SYS__DUMP_TRACELETS_METHODDEF
2884
2843
{NULL, NULL} // sentinel
0 commit comments