Skip to content

Commit

Permalink
stubtest: don't error for a missing submodule if the submodule name i…
Browse files Browse the repository at this point in the history
…s private (#13417)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
  • Loading branch information
AlexWaygood and hauntsaninja authored Aug 15, 2022
1 parent 7bddcf6 commit 9a9bc3b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mypy/stubtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,11 @@ def test_module(module_name: str) -> Iterator[Error]:
"""
stub = get_stub(module_name)
if stub is None:
runtime_desc = repr(sys.modules[module_name]) if module_name in sys.modules else "N/A"
yield Error(
[module_name], "failed to find stubs", MISSING, None, runtime_desc=runtime_desc
)
if not is_probably_private(module_name.split(".")[-1]):
runtime_desc = repr(sys.modules[module_name]) if module_name in sys.modules else "N/A"
yield Error(
[module_name], "failed to find stubs", MISSING, None, runtime_desc=runtime_desc
)
return

try:
Expand Down

0 comments on commit 9a9bc3b

Please sign in to comment.