summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-06-01 11:33:33 (GMT)
committerGeorg Brandl <georg@python.org>2007-06-01 11:33:33 (GMT)
commita5ea68905a6ad2486827de35a49e2f25da4a8ee8 (patch)
treee3b30245c1bdbf37885e820843ed64c2dc976a75 /Python/compile.c
parent4a700bb4698c1ec7f94b26f78f866929b013647f (diff)
downloadcpython-a5ea68905a6ad2486827de35a49e2f25da4a8ee8.zip
cpython-a5ea68905a6ad2486827de35a49e2f25da4a8ee8.tar.gz
cpython-a5ea68905a6ad2486827de35a49e2f25da4a8ee8.tar.bz2
Bug #1722484: remove docstrings again when running with -OO.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index f051d13..01dbb1a 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1119,7 +1119,8 @@ compiler_body(struct compiler *c, asdl_seq *stmts)
if (!asdl_seq_LEN(stmts))
return 1;
st = (stmt_ty)asdl_seq_GET(stmts, 0);
- if (compiler_isdocstring(st)) {
+ if (compiler_isdocstring(st) && Py_OptimizeFlag < 2) {
+ /* don't generate docstrings if -OO */
i = 1;
VISIT(c, expr, st->v.Expr.value);
if (!compiler_nameop(c, __doc__, Store))