Fix an embarrassing UnboundLocalError
This commit is contained in:
parent
cb5aadad74
commit
bc6b912fcb
18
black.py
18
black.py
@ -2088,14 +2088,16 @@ def max_delimiter_priority_in_atom(node: LN) -> int:
|
|||||||
|
|
||||||
first = node.children[0]
|
first = node.children[0]
|
||||||
last = node.children[-1]
|
last = node.children[-1]
|
||||||
if first.type == token.LPAR and last.type == token.RPAR:
|
if not (first.type == token.LPAR and last.type == token.RPAR):
|
||||||
bt = BracketTracker()
|
return 0
|
||||||
for c in node.children[1:-1]:
|
|
||||||
if isinstance(c, Leaf):
|
bt = BracketTracker()
|
||||||
bt.mark(c)
|
for c in node.children[1:-1]:
|
||||||
else:
|
if isinstance(c, Leaf):
|
||||||
for leaf in c.leaves():
|
bt.mark(c)
|
||||||
bt.mark(leaf)
|
else:
|
||||||
|
for leaf in c.leaves():
|
||||||
|
bt.mark(leaf)
|
||||||
try:
|
try:
|
||||||
return bt.max_delimiter_priority()
|
return bt.max_delimiter_priority()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user