Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve new flake8-bugbear errors (B020) #2950

Merged
merged 3 commits into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/black/linegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,9 @@ def dont_increase_indentation(split_func: Transformer) -> Transformer:

@wraps(split_func)
def split_wrapper(line: Line, features: Collection[Feature] = ()) -> Iterator[Line]:
for line in split_func(line, features):
normalize_prefix(line.leaves[0], inside_brackets=True)
yield line
for split_line in split_func(line, features):
normalize_prefix(split_line.leaves[0], inside_brackets=True)
yield split_line

return split_wrapper

Expand Down
4 changes: 2 additions & 2 deletions src/black/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ def stringify_ast(node: Union[ast.AST, ast3.AST], depth: int = 0) -> Iterator[st
and isinstance(node, (ast.Delete, ast3.Delete))
and isinstance(item, (ast.Tuple, ast3.Tuple))
):
for item in item.elts:
yield from stringify_ast(item, depth + 2)
for elt in item.elts:
yield from stringify_ast(elt, depth + 2)

elif isinstance(item, (ast.AST, ast3.AST)):
yield from stringify_ast(item, depth + 2)
Expand Down