diff --git a/src/black/parsing.py b/src/black/parsing.py index 13fa67ee84d..6b63368871c 100644 --- a/src/black/parsing.py +++ b/src/black/parsing.py @@ -206,7 +206,7 @@ def stringify_ast(node: Union[ast.AST, ast3.AST], depth: int = 0) -> Iterator[st break try: - value = getattr(node, field) + value: object = getattr(node, field) except AttributeError: continue @@ -237,6 +237,7 @@ def stringify_ast(node: Union[ast.AST, ast3.AST], depth: int = 0) -> Iterator[st yield from stringify_ast(value, depth + 2) else: + normalized: object # Constant strings may be indented across newlines, if they are # docstrings; fold spaces after newlines when comparing. Similarly, # trailing and leading space may be removed.