Fix typing problems
@@ -23,7 +23,7 @@ from astroid.nodes.as_string import to_code
_LOGGER = logging.getLogger(__name__)
AstroidFunctionDef = Union[astroid.AsyncFunctionDef, ast.FunctionDef]
-ASTFunctionDef = Union[astroid.AsyncFunctionDef, ast.FunctionDef]
+ASTFunctionDef = Union[ast.AsyncFunctionDef, ast.FunctionDef]
def has_decorator(
@@ -481,7 +481,7 @@ def astroid_to_ast(astroid_in: AstroidFunctionDef) -> ASTFunctionDef:
The ast function def
"""
# TODO(fk) port all of the analysis to astroid so this is no longer necessary.
- return ast.parse(to_code(astroid_in)).body[0]
+ return ast.parse(to_code(astroid_in)).body[0] # type: ignore
def get_function_node_from_ast(
