GH-65961: Stop setting __cached__ on modules

This commit is contained in:
Brett Cannon 2025-12-01 15:23:16 -08:00
parent e32c975640
commit 28f1334f1a
32 changed files with 93 additions and 240 deletions

View file

@ -182,8 +182,6 @@ def test_file_from_empty_string_dir(self):
warnings.simplefilter('ignore', DeprecationWarning)
mod = loader.load_module('_temp')
self.assertEqual(file_path, mod.__file__)
self.assertEqual(self.util.cache_from_source(file_path),
mod.__cached__)
finally:
os.unlink(file_path)
pycache = os.path.dirname(self.util.cache_from_source(file_path))
@ -219,8 +217,7 @@ def test_timestamp_overflow(self):
with warnings.catch_warnings():
warnings.simplefilter('ignore', DeprecationWarning)
mod = loader.load_module('_temp')
# Sanity checks.
self.assertEqual(mod.__cached__, compiled)
# Safety checks.
self.assertEqual(mod.x, 5)
# The pyc file was created.
self.assertTrue(os.path.exists(compiled))