Skip to content

Commit

Permalink
Cherry pick psf#3735.
Browse files Browse the repository at this point in the history
Why not rebase? Black has unreleased changes in blib2to3, rebasing will make Pyink releases harder. Will wait for a new Black release before we rebase.

PiperOrigin-RevId: 540903043
  • Loading branch information
yilei authored and Copybara-Service committed Jun 16, 2023
1 parent 0cc6825 commit a733067
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/pyink/linegen.py
Expand Up @@ -1008,6 +1008,13 @@ def bracket_split_build_line(
)
if isinstance(node, Node) and isinstance(node.prev_sibling, Leaf)
)
# Except the false negatives above for PEP 604 unions where we
# can't add the comma.
and not (
leaves[0].parent
and leaves[0].parent.next_sibling
and leaves[0].parent.next_sibling.type == token.VBAR
)
)

if original.is_import or no_commas:
Expand Down

0 comments on commit a733067

Please sign in to comment.