Skip to content

Commit

Permalink
Recognise typeshed submodules in VERSIONS (#11069)
Browse files Browse the repository at this point in the history
Fixes #10483

Tested manually using importlib.metadata

Co-authored-by: hauntsaninja <>
  • Loading branch information
hauntsaninja authored Sep 8, 2021
1 parent 725a24a commit bbea3b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mypy/modulefinder.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ def find_module(self, id: str, *, fast_path: bool = False) -> ModuleSearchResult
if id not in self.results:
top_level = id.partition('.')[0]
use_typeshed = True
if top_level in self.stdlib_py_versions:
if id in self.stdlib_py_versions:
use_typeshed = self._typeshed_has_version(id)
elif top_level in self.stdlib_py_versions:
use_typeshed = self._typeshed_has_version(top_level)
self.results[id] = self._find_module(id, use_typeshed)
if (not fast_path
Expand Down

0 comments on commit bbea3b5

Please sign in to comment.