summaryrefslogtreecommitdiffstats
path: root/Tools/compiler/astgen.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-18 00:14:37 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-18 00:14:37 (GMT)
commitab427b8ccedacf94acdc0149fc8fb24f8c58c272 (patch)
tree34d58e081f96a0db82ca42805ee30147bfb2bd65 /Tools/compiler/astgen.py
parentec5bfd13cada33ed36f93fd76b1355ce9ee2710f (diff)
downloadcpython-ab427b8ccedacf94acdc0149fc8fb24f8c58c272.zip
cpython-ab427b8ccedacf94acdc0149fc8fb24f8c58c272.tar.gz
cpython-ab427b8ccedacf94acdc0149fc8fb24f8c58c272.tar.bz2
Generate correct reprs for Mul, Add, etc.
Diffstat (limited to 'Tools/compiler/astgen.py')
-rw-r--r--Tools/compiler/astgen.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Tools/compiler/astgen.py b/Tools/compiler/astgen.py
index 9386bf0..c0eb464 100644
--- a/Tools/compiler/astgen.py
+++ b/Tools/compiler/astgen.py
@@ -81,6 +81,8 @@ class NodeInfo:
print >> buf, " def __repr__(self):"
if self.argnames:
fmt = COMMA.join(["%s"] * self.nargs)
+ if '(' in self.args:
+ fmt = '(%s)' % fmt
vals = ["repr(self.%s)" % name for name in self.argnames]
vals = COMMA.join(vals)
if self.nargs == 1: