summaryrefslogtreecommitdiffstats
path: root/Lib/lib2to3/fixer_util.py
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2008-09-01 19:56:06 (GMT)
committerBenjamin Peterson <benjamin@python.org>2008-09-01 19:56:06 (GMT)
commitcf60382420f849881c3e1e9d691d9da2d4e95bc7 (patch)
treefb6dcd7d4a7c3d92e5735dff0615eef5a87dafae /Lib/lib2to3/fixer_util.py
parent2cb598f13101f5997755e15251d41f64da5905bf (diff)
downloadcpython-cf60382420f849881c3e1e9d691d9da2d4e95bc7.zip
cpython-cf60382420f849881c3e1e9d691d9da2d4e95bc7.tar.gz
cpython-cf60382420f849881c3e1e9d691d9da2d4e95bc7.tar.bz2
Merged revisions 66117 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ................ r66117 | benjamin.peterson | 2008-09-01 12:17:22 -0500 (Mon, 01 Sep 2008) | 25 lines Merged revisions 65887,65889,65967-65968,65981 via svnmerge from svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3 ........ r65887 | benjamin.peterson | 2008-08-19 17:45:04 -0500 (Tue, 19 Aug 2008) | 1 line allow the raw_input fixer to handle calls after the raw_input (ie. raw_input().split()) ........ r65889 | benjamin.peterson | 2008-08-19 18:11:03 -0500 (Tue, 19 Aug 2008) | 1 line no need for 2.4 compatibility now ........ r65967 | benjamin.peterson | 2008-08-21 18:43:37 -0500 (Thu, 21 Aug 2008) | 1 line allow a Call to have no arguments ........ r65968 | benjamin.peterson | 2008-08-21 18:45:13 -0500 (Thu, 21 Aug 2008) | 1 line add a fixer for sys.exc_info etc by Jeff Balogh #2357 ........ r65981 | benjamin.peterson | 2008-08-22 15:41:30 -0500 (Fri, 22 Aug 2008) | 1 line add a fixer to add parenthese for list and gen comps #2367 ........ ................
Diffstat (limited to 'Lib/lib2to3/fixer_util.py')
-rw-r--r--Lib/lib2to3/fixer_util.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/lib2to3/fixer_util.py b/Lib/lib2to3/fixer_util.py
index 2b1cea5..4b5ca34 100644
--- a/Lib/lib2to3/fixer_util.py
+++ b/Lib/lib2to3/fixer_util.py
@@ -51,12 +51,12 @@ def Dot():
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: