Skip to content

Commit ed41f9a

Browse files
author
Bartosz Sławecki
authored
Narrow AST parsing result type to ast.Module at all times (#116)
1 parent 8baa750 commit ed41f9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

typeshed_client/finder.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get_stub_file(
105105

106106
def get_stub_ast(
107107
module_name: str, *, search_context: Optional[SearchContext] = None
108-
) -> Optional[ast.AST]:
108+
) -> Optional[ast.Module]:
109109
"""Return the AST for the stub for the given module name."""
110110
path = get_stub_file(module_name, search_context=search_context)
111111
if path is None:
@@ -366,7 +366,7 @@ def find_typeshed() -> Path:
366366
return importlib_resources.files("typeshed_client") / "typeshed"
367367

368368

369-
def parse_stub_file(path: Path) -> ast.AST:
369+
def parse_stub_file(path: Path) -> ast.Module:
370370
text = path.read_text()
371371
return ast.parse(text, filename=str(path))
372372

0 commit comments

Comments
 (0)