From 6fa793743860194683baa2a2243336bbb9dc18b2 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 16 Aug 2021 09:29:49 +0100 Subject: [PATCH] Fix type hint for build_ast `ast.parse` returns an `ast.Module` in its default mode, 'exec': https://github.com/python/typeshed/blob/3ce5502675d3c23394b592f00234fbdfc743a7d5/stdlib/ast.pyi#L159-L167 Therefore this type hint can be more specific. --- src/flake8/processor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flake8/processor.py b/src/flake8/processor.py index 6b7d3c4..4b96205 100644 --- a/src/flake8/processor.py +++ b/src/flake8/processor.py @@ -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))