X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/a44dc3d59eb46901f9fe893727280903df41fc20..73c2d5514ce604141abe176b1f3e5cd35ff51d56:/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...