X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/ab8651371075ced6f58f519e48fc4e8ac529e8ce..389e9c23a9e622ee6090d902cc5f56c5f76cdee9:/src/black/__init__.py diff --git a/src/black/__init__.py b/src/black/__init__.py index 59018d0..d8b9819 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -1210,6 +1210,21 @@ def get_features_used( # noqa: C901 if argch.type in STARS: features.add(feature) + elif ( + n.type in {syms.return_stmt, syms.yield_expr} + and len(n.children) >= 2 + and n.children[1].type == syms.testlist_star_expr + and any(child.type == syms.star_expr for child in n.children[1].children) + ): + features.add(Feature.UNPACKING_ON_FLOW) + + elif ( + n.type == syms.annassign + and len(n.children) >= 4 + and n.children[3].type == syms.testlist_star_expr + ): + features.add(Feature.ANN_ASSIGN_EXTENDED_RHS) + # Python 2 only features (for its deprecation) except for integers, see above elif n.type == syms.print_stmt: features.add(Feature.PRINT_STMT) @@ -1305,7 +1320,7 @@ def assert_equivalent(src: str, dst: str, *, pass_num: int = 1) -> None: src_ast = parse_ast(src) except Exception as exc: raise AssertionError( - "cannot use --safe with this file; failed to parse source file." + f"cannot use --safe with this file; failed to parse source file: {exc}" ) from exc try: