X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/0967dfcbeba8aceaacd468b279cc23089d697878..1747c388bba0c87f75a6239d56e3b51f7455e93d:/black.py diff --git a/black.py b/black.py index d2d23c8..151dc8c 100644 --- a/black.py +++ b/black.py @@ -2337,7 +2337,7 @@ def is_python36(node: Node) -> bool: Currently looking for: - f-strings; and - - trailing commas after * or ** in function signatures. + - trailing commas after * or ** in function signatures and calls. """ for n in node.pre_order(): if n.type == token.STRING: @@ -2346,7 +2346,7 @@ def is_python36(node: Node) -> bool: return True elif ( - n.type == syms.typedargslist + n.type in {syms.typedargslist, syms.arglist} and n.children and n.children[-1].type == token.COMMA ): @@ -2354,6 +2354,11 @@ def is_python36(node: Node) -> bool: if ch.type in STARS: return True + if ch.type == syms.argument: + for argch in ch.children: + if argch.type in STARS: + return True + return False