mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Don't include doc string of class in its code child
This commit is contained in:
parent
8aea0cc94e
commit
da8db8ca18
2 changed files with 10 additions and 0 deletions
|
@ -222,6 +222,11 @@ class Transformer:
|
|||
# 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…
Add table
Add a link
Reference in a new issue