summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-06-01 11:33:45 +0000
committerGeorg Brandl <georg@python.org>2007-06-01 11:33:45 +0000
commitba871a06fb5fe36d4f77c2f1db3257b0c1975651 (patch)
tree5fbc2403e7c3eb67b2b4a8a0a818a1f2f6764ed5 /Python
parentb40092bf98d8905a46a4bca1a5358897309f800c (diff)
downloadcpython-git-ba871a06fb5fe36d4f77c2f1db3257b0c1975651.tar.gz
Bug #1722484: remove docstrings again when running with -OO.
(backport from rev. 55732)
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index e493beb6c2..5ac1702952 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1779,7 +1779,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))