Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32k
gh-129027: Raise DeprecationWarning for sys._clear_type_cache#129043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
bac8a24
3d2bca7
4b45930
8366a2d
0310eb2
c98e6dc
da4c9c1
bc1844e
bb4d5e4
160f0f7
aa1cc67
a19ea6b
edb99cf
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1203,6 +1203,9 @@ sys | ||
* On FreeBSD, :data:`sys.platform` doesn't contain the major version anymore. | ||
It is always ``'freebsd'``, instead of ``'freebsd13'`` or ``'freebsd14'``. | ||
* Raise :exc:`DeprecationWarning` for :func:`sys._clear_type_cache`. This | ||
function was deprecated in Python 3.13 but it didn't raise a runtime warning. | ||
srinivasreddy marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
sys.monitoring | ||
-------------- | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -9,6 +9,7 @@ | ||
import tempfile | ||
import textwrap | ||
import unittest | ||
import warnings | ||
from test import support | ||
from test.support import os_helper | ||
from test.support import force_not_colorized | ||
@@ -936,14 +937,20 @@ def test_python_asyncio_debug(self): | ||
@unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option") | ||
def test_python_dump_refs(self): | ||
code = 'import sys; sys._clear_type_cache()' | ||
# TODO: Remove warnings context manager once sys._clear_type_cache is removed | ||
with warnings.catch_warnings(): | ||
warnings.simplefilter("ignore", DeprecationWarning) | ||
rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFS='1') | ||
picnixz marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
self.assertEqual(rc, 0) | ||
@unittest.skipUnless(sysconfig.get_config_var('Py_TRACE_REFS'), "Requires --with-trace-refs build option") | ||
def test_python_dump_refs_file(self): | ||
with tempfile.NamedTemporaryFile() as dump_file: | ||
code = 'import sys; sys._clear_type_cache()' | ||
# TODO: Remove warnings context manager once sys._clear_type_cache is removed | ||
with warnings.catch_warnings(): | ||
picnixz marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
warnings.simplefilter("ignore", DeprecationWarning) | ||
rc, out, err = assert_python_ok('-c', code, PYTHONDUMPREFSFILE=dump_file.name) | ||
self.assertEqual(rc, 0) | ||
with open(dump_file.name, 'r') as file: | ||
contents = file.read() | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Raise :exc:`DeprecationWarning` for :func:`sys._clear_type_cache`. This function was deprecated in Python 3.13 | ||
but it didn't raise a runtime warning. |
Uh oh!
There was an error while loading.Please reload this page.