Skip to content
Merged
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
4 changes: 3 additions & 1 deletion mypy/semanal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,9 @@ def report_missing_module_attribute(
if self.is_incomplete_namespace(import_id):
# We don't know whether the name will be there, since the namespace
# is incomplete. Defer the current target.
self.mark_incomplete(imported_id, context)
self.mark_incomplete(
imported_id, context, module_public=module_public, module_hidden=module_hidden
)
return
message = 'Module "{}" has no attribute "{}"'.format(import_id, source_id)
# Suggest alternatives, if any match is found.
Expand Down
25 changes: 25 additions & 0 deletions test-data/unit/check-incremental.test
Original file line number Diff line number Diff line change
Expand Up @@ -5585,3 +5585,28 @@ bar.x + 0
x = 0
[rechecked]
[stale]

[case testExplicitReexportImportCycleWildcard]
# flags: --no-implicit-reexport
import pkg.a
[file pkg/__init__.pyi]

[file pkg/a.pyi]
MYPY = False
if MYPY:
from pkg.b import B

[file pkg/b.pyi]
import pkg.a
MYPY = False
if MYPY:
from pkg.c import C
class B:
pass

[file pkg/c.pyi]
from pkg.a import *
class C:
pass
[rechecked]
[stale]