[Python-checkins] r65967 - sandbox/trunk/2to3/lib2to3/fixer_util.py

benjamin.peterson python-checkins at python.org
Fri Aug 22 01:43:37 CEST 2008


Author: benjamin.peterson
Date: Fri Aug 22 01:43:37 2008
New Revision: 65967

Log:
allow a Call to have no arguments

Modified:
   sandbox/trunk/2to3/lib2to3/fixer_util.py

Modified: sandbox/trunk/2to3/lib2to3/fixer_util.py
==============================================================================
--- sandbox/trunk/2to3/lib2to3/fixer_util.py	(original)
+++ sandbox/trunk/2to3/lib2to3/fixer_util.py	Fri Aug 22 01:43:37 2008
@@ -51,12 +51,12 @@
 
 def ArgList(args, lparen=LParen(), rparen=RParen()):
     """A parenthesised argument list, used by Call()"""
-    return Node(syms.trailer,
-                [lparen.clone(),
-                 Node(syms.arglist, args),
-                 rparen.clone()])
+    node = Node(syms.trailer, [lparen.clone(), rparen.clone()])
+    if args:
+        node.insert_child(1, Node(syms.arglist, args))
+    return node
 
-def Call(func_name, args, prefix=None):
+def Call(func_name, args=None, prefix=None):
     """A function call"""
     node = Node(syms.power, [func_name, ArgList(args)])
     if prefix is not None:


More information about the Python-checkins mailing list