Mercurial > cpython-lru_cache-weakref
diff Python/compile.c @ 43403:692493771ae3 2.5
Fix #1169: remove docstrings in functions for -OO.
(backport from rev. 58204)
| author | Georg Brandl <georg@python.org> |
|---|---|
| date | Wed, 19 Sep 2007 06:37:26 +0000 |
| parents | fec1296544ab |
| children | 8103f0198967 |
line wrap: on
line diff
--- a/Python/compile.c Tue Sep 18 23:38:15 2007 +0000 +++ b/Python/compile.c Wed Sep 19 06:37:26 2007 +0000 @@ -1983,7 +1983,7 @@ 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);
