Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,6 @@ def __init__(
# since it's possible that the name will be there once the namespace is complete.
self.incomplete_namespaces = incomplete_namespaces
self.all_exports: list[str] = []
# Map from module id to list of explicitly exported names (i.e. names in __all__).
# This is used by stubgen/stubtest, DO NOT use for any other purposes as it is
# not populated on incremental runs (nor in parallel mode).
self.export_map: dict[str, list[str]] = {}
self.plugin = plugin
# If True, process function definitions. If False, don't. This is used
# for processing module top levels in fine-grained incremental mode.
Expand Down Expand Up @@ -724,7 +720,6 @@ def refresh_top_level(self, file_node: MypyFile) -> None:
if file_node.fullname == "typing_extensions":
self.add_typing_extension_aliases(file_node)
self.adjust_public_exports()
self.export_map[self.cur_mod_id] = self.all_exports
self.all_exports = []

def add_implicit_module_attrs(self, file_node: MypyFile) -> None:
Expand Down
4 changes: 3 additions & 1 deletion mypy/stubgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -1773,7 +1773,9 @@ def generate_asts_for_modules(
mod.ast = res.graph[mod.module].tree
# Use statically inferred __all__ if there is no runtime one.
if mod.runtime_all is None:
mod.runtime_all = res.manager.semantic_analyzer.export_map[mod.module]
mod_names = res.manager.semantic_analyzer.modules[mod.module].names
if "__all__" in mod_names:
mod.runtime_all = [name for name, sym in mod_names.items() if sym.module_public]


def generate_stub_for_py_module(
Expand Down