summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/fixes/fix_apply.py
diff options
context:
space:
mode:
authorGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>2016-09-10 01:18:52 (GMT)
committerGregory P. Smith ext:(%20%5BGoogle%20Inc.%5D) <greg@krypto.org>2016-09-10 01:18:52 (GMT)
commit28325749c01815097aa2bc06508004a1f894c279 (patch)
tree83219772233a4f8b3d8db1df9bfb6b573fe39bfe /Lib/lib2to3/fixes/fix_apply.py
parentdbdf029a5575f6e6ec0140260236963ed7d2c2be (diff)
downloadcpython-28325749c01815097aa2bc06508004a1f894c279.zip
cpython-28325749c01815097aa2bc06508004a1f894c279.tar.gz
cpython-28325749c01815097aa2bc06508004a1f894c279.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.py11
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