mirror of
https://github.com/python/cpython.git
synced 2025-10-22 14:42:22 +00:00
gh-125900: Clean-up logic around immortalization in free-threading (#125901)
* Remove `@suppress_immortalization` decorator * Make suppression flag per-thread instead of per-interpreter * Suppress immortalization in `eval()` to avoid refleaks in three tests (test_datetime.test_roundtrip, test_logging.test_config8_ok, and test_random.test_after_fork). * frozenset() is constant, but not a singleton. When run multiple times, the test could fail due to constant interning.
This commit is contained in:
parent
1306f33c84
commit
332356b880
23 changed files with 36 additions and 137 deletions
|
@ -17,7 +17,7 @@ import unittest
|
|||
from datetime import date, datetime, time, timedelta, timezone
|
||||
from functools import cached_property
|
||||
|
||||
from test.support import MISSING_C_DOCSTRINGS, requires_gil_enabled
|
||||
from test.support import MISSING_C_DOCSTRINGS
|
||||
from test.test_zoneinfo import _support as test_support
|
||||
from test.test_zoneinfo._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase
|
||||
from test.support.import_helper import import_module, CleanImport
|
||||
|
@ -1931,7 +1931,6 @@ class ExtensionBuiltTest(unittest.TestCase):
|
|||
self.assertFalse(hasattr(c_zoneinfo.ZoneInfo, "_weak_cache"))
|
||||
self.assertTrue(hasattr(py_zoneinfo.ZoneInfo, "_weak_cache"))
|
||||
|
||||
@requires_gil_enabled("gh-117783: types may be immortalized")
|
||||
def test_gc_tracked(self):
|
||||
import gc
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue