Skip to content

Commit d043dd6

Browse files
committed
.
1 parent 9933822 commit d043dd6

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

mypy/stubgen.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,11 +1773,9 @@ def generate_asts_for_modules(
17731773
mod.ast = res.graph[mod.module].tree
17741774
# Use statically inferred __all__ if there is no runtime one.
17751775
if mod.runtime_all is None:
1776-
mod.runtime_all = [
1777-
name
1778-
for name, sym in res.manager.semantic_analyzer.modules[mod.module].names.items()
1779-
if sym.module_public
1780-
]
1776+
mod_names = res.manager.semantic_analyzer.modules[mod.module].names
1777+
if "__all__" in mod_names:
1778+
mod.runtime_all = [name for name, sym in mod_names.items() if sym.module_public]
17811779

17821780

17831781
def generate_stub_for_py_module(

0 commit comments

Comments
 (0)