Make flake8 pass when run with Python 3.12 (#4050)

This commit is contained in:
Alex Waygood 2023-11-18 19:41:46 +00:00 committed by GitHub
parent 85b1c71a34
commit c4cd200a06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -175,7 +175,7 @@ def stringify_ast(node: ast.AST, depth: int = 0) -> Iterator[str]:
except AttributeError: except AttributeError:
continue continue
yield f"{' ' * (depth+1)}{field}=" yield f"{' ' * (depth + 1)}{field}="
if isinstance(value, list): if isinstance(value, list):
for item in value: for item in value:
@ -211,6 +211,6 @@ def stringify_ast(node: ast.AST, depth: int = 0) -> Iterator[str]:
normalized = value.rstrip() normalized = value.rstrip()
else: else:
normalized = value normalized = value
yield f"{' ' * (depth+2)}{normalized!r}, # {value.__class__.__name__}" yield f"{' ' * (depth + 2)}{normalized!r}, # {value.__class__.__name__}"
yield f"{' ' * depth}) # /{node.__class__.__name__}" yield f"{' ' * depth}) # /{node.__class__.__name__}"