diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-08-02 00:24:26 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-08-02 00:24:26 (GMT) |
| commit | 8dc04a4dd1fc0e8c5feaba7308eaf8b8c8df8373 (patch) | |
| tree | 8a4de788c6c22e4d185f43b199735b44607fdf88 /Tools/compiler/astgen.py | |
| parent | 8c7fe2d6f98908a597fec05767dc8a032c06dc61 (diff) | |
| download | cpython-8dc04a4dd1fc0e8c5feaba7308eaf8b8c8df8373.zip cpython-8dc04a4dd1fc0e8c5feaba7308eaf8b8c8df8373.tar.gz cpython-8dc04a4dd1fc0e8c5feaba7308eaf8b8c8df8373.tar.bz2 | |
Merged revisions 77310-77311 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r77310 | antoine.pitrou | 2010-01-05 01:22:44 +0200 (Tue, 05 Jan 2010) | 4 lines
Issue #7092: Fix the DeprecationWarnings emitted by the standard library
when using the -3 flag. Patch by Florent Xicluna.
........
r77311 | antoine.pitrou | 2010-01-05 01:28:16 +0200 (Tue, 05 Jan 2010) | 3 lines
Kill a couple of "<>"
........
Diffstat (limited to 'Tools/compiler/astgen.py')
| -rw-r--r-- | Tools/compiler/astgen.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Tools/compiler/astgen.py b/Tools/compiler/astgen.py index c431d22..1724276 100644 --- a/Tools/compiler/astgen.py +++ b/Tools/compiler/astgen.py @@ -105,12 +105,18 @@ class NodeInfo: def _gen_init(self, buf): if self.args: - print >> buf, " def __init__(self, %s, lineno=None):" % self.args + argtuple = '(' in self.args + args = self.args if not argtuple else ''.join(self.argnames) + print >> buf, " def __init__(self, %s, lineno=None):" % args else: print >> buf, " def __init__(self, lineno=None):" if self.argnames: - for name in self.argnames: - print >> buf, " self.%s = %s" % (name, name) + if argtuple: + for idx, name in enumerate(self.argnames): + print >> buf, " self.%s = %s[%s]" % (name, args, idx) + else: + for name in self.argnames: + print >> buf, " self.%s = %s" % (name, name) print >> buf, " self.lineno = lineno" # Copy the lines in self.init, indented four spaces. The rstrip() # business is to get rid of the four spaces if line happens to be |
