mirror of https://github.com/python/cpython.git
Don't include doc string of class in its code child
This commit is contained in:
parent
8aea0cc94e
commit
da8db8ca18
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue