File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 150150from mypy .renaming import LimitedVariableRenameVisitor , VariableRenameVisitor
151151from mypy .stats import dump_type_stats
152152from mypy .stubinfo import is_module_from_legacy_bundled_package , stub_distribution_name
153- from mypy .known_modules import get_known_modules
153+ from mypy .known_modules import get_known_modules , reset_known_modules_cache
154154from mypy .messages import best_matches , pretty_seq
155155from mypy .types import Type , instance_cache
156156from mypy .typestate import reset_global_state , type_state
@@ -337,6 +337,7 @@ def build(
337337
338338 # This is mostly for the benefit of tests that use builtins fixtures.
339339 instance_cache .reset ()
340+ reset_known_modules_cache ()
340341
341342 def default_flush_errors (
342343 filename : str | None , new_messages : list [str ], is_serious : bool
Original file line number Diff line number Diff line change 152152
153153_known_modules_cache : frozenset [str ] | None = None
154154
155+ def reset_known_modules_cache () -> None :
156+ global _known_modules_cache
157+ _known_modules_cache = None
158+
155159
156160def get_stdlib_modules (
157161 stdlib_versions : StdlibVersions ,
You can’t perform that action at this time.
0 commit comments