summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 17:19:02 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2001-08-29 17:19:02 (GMT)
commitda8db8ca186ab8a811b44b90816b57b6f20caa61 (patch)
tree854e617a5baf5607c4b3f3d1c6d9f487a49da46c /Tools
parent8aea0cc94e1949a2fa06924d058a7d150238544a (diff)
downloadcpython-da8db8ca186ab8a811b44b90816b57b6f20caa61.zip
cpython-da8db8ca186ab8a811b44b90816b57b6f20caa61.tar.gz
cpython-da8db8ca186ab8a811b44b90816b57b6f20caa61.tar.bz2
Don't include doc string of class in its code child
Diffstat (limited to 'Tools')
-rw-r--r--Tools/compiler/compiler/transformer.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tools/compiler/compiler/transformer.py b/Tools/compiler/compiler/transformer.py
index 7f6a1b4..7f61595 100644
--- a/Tools/compiler/compiler/transformer.py
+++ b/Tools/compiler/compiler/transformer.py
@@ -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