Don't include doc string of class in its code child

This commit is contained in:
Jeremy Hylton 2001-08-29 17:19:02 +00:00
parent 8aea0cc94e
commit da8db8ca18
2 changed files with 10 additions and 0 deletions

View File

@ -222,6 +222,11 @@ def classdef(self, nodelist):
# code for class
code = self.com_node(nodelist[-1])
if doc is not None:
assert isinstance(code, Stmt)
assert isinstance(code.nodes[0], Discard)
del code.nodes[0]
n = Class(name, bases, doc, code)
n.lineno = nodelist[1][2]
return n

View File

@ -222,6 +222,11 @@ def classdef(self, nodelist):
# code for class
code = self.com_node(nodelist[-1])
if doc is not None:
assert isinstance(code, Stmt)
assert isinstance(code.nodes[0], Discard)
del code.nodes[0]
n = Class(name, bases, doc, code)
n.lineno = nodelist[1][2]
return n