Ignore:
Timestamp:
Mar 19, 2014, 11:11:30 AM (11 years ago)
Author:
dmik
Message:

python: Update vendor to 2.7.6.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/vendor/current/Tools/compiler/astgen.py

    r2 r388  
    106106    def _gen_init(self, buf):
    107107        if self.args:
    108             print >> buf, "    def __init__(self, %s, lineno=None):" % self.args
     108            argtuple = '(' in self.args
     109            args = self.args if not argtuple else ''.join(self.argnames)
     110            print >> buf, "    def __init__(self, %s, lineno=None):" % args
    109111        else:
    110112            print >> buf, "    def __init__(self, lineno=None):"
    111113        if self.argnames:
    112             for name in self.argnames:
    113                 print >> buf, "        self.%s = %s" % (name, name)
     114            if argtuple:
     115                for idx, name in enumerate(self.argnames):
     116                    print >> buf, "        self.%s = %s[%s]" % (name, args, idx)
     117            else:
     118                for name in self.argnames:
     119                    print >> buf, "        self.%s = %s" % (name, name)
    114120        print >> buf, "        self.lineno = lineno"
    115121        # Copy the lines in self.init, indented four spaces.  The rstrip()
Note: See TracChangeset for help on using the changeset viewer.