Fix type hint for build_ast

`ast.parse` returns an `ast.Module` in its default mode, 'exec':

3ce5502675/stdlib/ast.pyi (L159-L167)

Therefore this type hint can be more specific.
This commit is contained in:
Adam Johnson 2021-08-16 09:29:49 +01:00 committed by GitHub
parent 542145fb7c
commit 6fa7937438
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -218,7 +218,7 @@ class FileProcessor:
(previous_row, previous_column) = end
return comments, logical, mapping
def build_ast(self) -> ast.AST:
def build_ast(self) -> ast.Module:
"""Build an abstract syntax tree from the list of lines."""
return ast.parse("".join(self.lines))