mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #25969: Update the lib2to3 grammar to handle the unpacking
generalizations added in 3.5.
This commit is contained in:
parent
dbdf029a55
commit
28325749c0
7 changed files with 91 additions and 6 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue