mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-129027: Raise DeprecationWarning for sys._clear_type_cache (#129043)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This commit is contained in:
parent
b402a4889b
commit
8783cec9b6
7 changed files with 37 additions and 7 deletions
|
@ -2208,6 +2208,14 @@ static PyObject *
|
|||
sys__clear_type_cache_impl(PyObject *module)
|
||||
/*[clinic end generated code: output=20e48ca54a6f6971 input=127f3e04a8d9b555]*/
|
||||
{
|
||||
if (PyErr_WarnEx(PyExc_DeprecationWarning,
|
||||
"sys._clear_type_cache() is deprecated and"
|
||||
" scheduled for removal in a future version."
|
||||
" Use sys._clear_internal_caches() instead.",
|
||||
1) < 0)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
PyType_ClearCache();
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue