Simplification: only use special-case token retrieval logic when magic trailing comma is present

This commit is contained in:
James Addison 2021-02-04 17:45:45 +00:00 committed by Łukasz Langa
parent 89c42a0011
commit 829331a877

View File

@ -6632,7 +6632,7 @@ def can_omit_invisible_parens(
penultimate = line.leaves[-2]
last = line.leaves[-1]
if line.should_split or line.magic_trailing_comma:
if line.magic_trailing_comma:
try:
penultimate, last = last_two_except(line.leaves, omit=omit_on_explode)
except LookupError: