diff options
| author | Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org> | 2016-09-10 01:19:51 (GMT) |
|---|---|---|
| committer | Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org> | 2016-09-10 01:19:51 (GMT) |
| commit | 3b822d6c89ac6dffe5304adf0ce77c2d42406338 (patch) | |
| tree | 9611fd543334e146032283448ecff2610ebd985a /Lib/lib2to3/fixes/fix_apply.py | |
| parent | 50a903de4cc050d0d4d3a02ab13036421909e4cf (diff) | |
| parent | 28325749c01815097aa2bc06508004a1f894c279 (diff) | |
| download | cpython-3b822d6c89ac6dffe5304adf0ce77c2d42406338.zip cpython-3b822d6c89ac6dffe5304adf0ce77c2d42406338.tar.gz cpython-3b822d6c89ac6dffe5304adf0ce77c2d42406338.tar.bz2 | |
Issue #25969: Update the lib2to3 grammar to handle the unpacking
generalizations added in 3.5.
Diffstat (limited to 'Lib/lib2to3/fixes/fix_apply.py')
| -rw-r--r-- | Lib/lib2to3/fixes/fix_apply.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/lib2to3/fixes/fix_apply.py b/Lib/lib2to3/fixes/fix_apply.py index 81a46dc..826ec8c 100644 --- a/Lib/lib2to3/fixes/fix_apply.py +++ b/Lib/lib2to3/fixes/fix_apply.py @@ -34,6 +34,17 @@ class FixApply(fixer_base.BaseFix): func = results["func"] args = results["args"] kwds = results.get("kwds") + # I feel like we should be able to express this logic in the + # PATTERN above but I don't know how to do it so... + if args: + if args.type == self.syms.star_expr: + return # Make no change. + if (args.type == self.syms.argument and + args.children[0].value == '**'): + return # Make no change. + if kwds and (kwds.type == self.syms.argument and + kwds.children[0].value == '**'): + return # Make no change. prefix = node.prefix func = func.clone() if (func.type not in (token.NAME, syms.atom) and |
