diff options
author | Guido van Rossum <guido@python.org> | 2007-03-19 17:56:01 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-03-19 17:56:01 (GMT) |
commit | d16e81aabe5448a90640694d57cdaefddf3a1a9f (patch) | |
tree | 1d422ec1ee0944f60ceedd91f69af4034cb170e6 /Lib/compiler/transformer.py | |
parent | 801dd736531f7d6db57a1dab80fe6daa37e0a0b0 (diff) | |
download | cpython-d16e81aabe5448a90640694d57cdaefddf3a1a9f.zip cpython-d16e81aabe5448a90640694d57cdaefddf3a1a9f.tar.gz cpython-d16e81aabe5448a90640694d57cdaefddf3a1a9f.tar.bz2 |
Fix the compiler package w.r.t. the new metaclass syntax.
(It is still broken w.r.t. the new nonlocal keyword.)
Remove a series of debug prints I accidentally left in test_ast.py.
Diffstat (limited to 'Lib/compiler/transformer.py')
-rw-r--r-- | Lib/compiler/transformer.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/compiler/transformer.py b/Lib/compiler/transformer.py index f07ec97..3d4bb4f 100644 --- a/Lib/compiler/transformer.py +++ b/Lib/compiler/transformer.py @@ -288,16 +288,16 @@ class Transformer: old_lambdef = lambdef def classdef(self, nodelist): - # classdef: 'class' NAME ['(' [testlist] ')'] ':' suite + # classdef: 'class' NAME ['(' [arglist] ')'] ':' suite name = nodelist[1][1] doc = self.get_docstring(nodelist[-1]) if nodelist[2][0] == token.COLON: - bases = [] + arglist = CallFunc(None, []) elif nodelist[3][0] == token.RPAR: - bases = [] + arglist = CallFunc(None, []) else: - bases = self.com_bases(nodelist[3]) + arglist = self.com_call_function(None, nodelist[3]) # code for class code = self.com_node(nodelist[-1]) @@ -307,7 +307,8 @@ class Transformer: assert isinstance(code.nodes[0], Discard) del code.nodes[0] - return Class(name, bases, doc, code, lineno=nodelist[1][2]) + return Class(name, arglist.args, arglist.star_args, arglist.dstar_args, + doc, code, lineno=nodelist[1][2]) def stmt(self, nodelist): return self.com_stmt(nodelist[0]) |