diff options
author | Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) <thatiparthysreenivas@gmail.com> | 2025-04-25 17:31:48 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-25 15:01:48 +0300 |
commit | 8783cec9b67b3860bda9496611044b6f310c6761 (patch) | |
tree | 76ac81113b2801cc0c915e76a7ab1b5b4602777b /Python | |
parent | b402a4889b690876c488a1d1ccc6d33add3f69c6 (diff) | |
download | cpython-8783cec9b67b3860bda9496611044b6f310c6761.tar.gz cpython-8783cec9b67b3860bda9496611044b6f310c6761.zip |
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>
Diffstat (limited to 'Python')
-rw-r--r-- | Python/sysmodule.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 3e0165acd6f..1a7b01bf97f 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -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; } |