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

@ -3408,20 +3408,20 @@ def _main():
sys.exit(1)
if args.details:
print('Target: {}'.format(target))
print('Origin: {}'.format(getsourcefile(module)))
print('Cached: {}'.format(module.__cached__))
print(f'Target: {target}')
print(f'Origin: {getsourcefile(module)}')
print(f'Cached: {module.__spec__.cached}')
if obj is module:
print('Loader: {}'.format(repr(module.__loader__)))
print(f'Loader: {module.__loader__!r}')
if hasattr(module, '__path__'):
print('Submodule search path: {}'.format(module.__path__))
print(f'Submodule search path: {module.__path__}')
else:
try:
__, lineno = findsource(obj)
except Exception:
pass
else:
print('Line: {}'.format(lineno))
print(f'Line: {lineno}')
print()
else: