X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a44dc3d59eb46901f9fe893727280903df41fc20..29dd25725303992d36c3a75c3a071080ac06085f:/src/black/trans.py diff --git a/src/black/trans.py b/src/black/trans.py index a5cf495..0eb53e2 100644 --- a/src/black/trans.py +++ b/src/black/trans.py @@ -1866,7 +1866,7 @@ class StringParenWrapper(BaseStringSplitter, CustomSplitMapMixin): for i, leaf in enumerate(LL): # We MUST find a colon, it can either be dict's or lambda's colon... - if leaf.type == token.COLON: + if leaf.type == token.COLON and i < len(LL) - 1: idx = i + 2 if is_empty_par(LL[i + 1]) else i + 1 # That colon MUST be followed by a string...