GH-114695: Add sys._clear_internal_caches (GH-115152)

This commit is contained in:
Brandt Bucher 2024-02-12 01:04:36 -08:00 committed by GitHub
parent 54bde5dcc3
commit 235cacff81
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 130 additions and 84 deletions

View file

@ -1131,6 +1131,24 @@ sys__clear_type_cache(PyObject *module, PyObject *Py_UNUSED(ignored))
return sys__clear_type_cache_impl(module);
}
PyDoc_STRVAR(sys__clear_internal_caches__doc__,
"_clear_internal_caches($module, /)\n"
"--\n"
"\n"
"Clear all internal performance-related caches.");
#define SYS__CLEAR_INTERNAL_CACHES_METHODDEF \
{"_clear_internal_caches", (PyCFunction)sys__clear_internal_caches, METH_NOARGS, sys__clear_internal_caches__doc__},
static PyObject *
sys__clear_internal_caches_impl(PyObject *module);
static PyObject *
sys__clear_internal_caches(PyObject *module, PyObject *Py_UNUSED(ignored))
{
return sys__clear_internal_caches_impl(module);
}
PyDoc_STRVAR(sys_is_finalizing__doc__,
"is_finalizing($module, /)\n"
"--\n"
@ -1486,4 +1504,4 @@ exit:
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
/*[clinic end generated code: output=3dc3b2cb0ce38ebb input=a9049054013a1b77]*/
/*[clinic end generated code: output=b8b1c53e04c3b20c input=a9049054013a1b77]*/