Merge pull request #6974 from odysseus-dev/test/import-stub-guard-snapshot-performance

test: avoid tuple-list allocation in the import-stub guard
This commit is contained in:
Alexandre Teixeira
2026-10-29 10:30:50 +00:00
committed by GitHub
+1 -1
View File
@@ -189,7 +189,7 @@ def bare_module_stubs():
test modules install them on purpose.
"""
found = set()
for name, mod in list(sys.modules.items()):
for name, mod in sys.modules.copy().items():
if not name.startswith(_GUARDED_PREFIXES):
continue
if type(mod) is not types.ModuleType: