summaryrefslogtreecommitdiff
path: root/Python
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-09-19 06:37:26 +0000
committerGeorg Brandl <georg@python.org>2007-09-19 06:37:26 +0000
commitdfecfdb23e10b6d273c2d5f4c257c93f46ce6cbb (patch)
treeca4e458ab0bd37d8ecff7d9cdc0f3bbd7d4fa777 /Python
parent5e84e8002406f105c049289c280b63d2763b7258 (diff)
downloadcpython-git-dfecfdb23e10b6d273c2d5f4c257c93f46ce6cbb.tar.gz
Fix #1169: remove docstrings in functions for -OO.
(backport from rev. 58204)
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 5ac1702952..ce19aa9df4 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1983,7 +1983,7 @@ compiler_function(struct compiler *c, stmt_ty s)
st = (stmt_ty)asdl_seq_GET(s->v.FunctionDef.body, 0);
docstring = compiler_isdocstring(st);
- if (docstring)
+ if (docstring && Py_OptimizeFlag < 2)
first_const = st->v.Expr.value->v.Str.s;
if (compiler_add_o(c, c->u->u_consts, first_const) < 0) {
compiler_exit_scope(c);