X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/e911c79809c4fd9b0773dea5b6a0e710b59614cf..5bc40707afa5fb53bbc2484ed34f69b011b98172:/black.py diff --git a/black.py b/black.py index 8a4eb05..203fbfa 100644 --- a/black.py +++ b/black.py @@ -872,7 +872,7 @@ def whitespace(leaf: Leaf) -> str: # noqa C901 return DOUBLESPACE assert p is not None, f"INTERNAL ERROR: hand-made leaf without parent: {leaf!r}" - if t == token.COLON and p.type != syms.subscript: + if t == token.COLON and p.type not in {syms.subscript, syms.subscriptlist}: return NO prev = leaf.prev_sibling @@ -905,7 +905,7 @@ def whitespace(leaf: Leaf) -> str: # noqa C901 return NO elif prevp.type == token.COLON: - if prevp.parent and prevp.parent.type == syms.subscript: + if prevp.parent and prevp.parent.type in {syms.subscript, syms.sliceop}: return NO elif prevp.parent and prevp.parent.type in {syms.factor, syms.star_expr}: