Fix #1169: remove docstrings in functions for -OO.

(backport from rev. 58204)
This commit is contained in:
Georg Brandl 2007-09-19 06:37:26 +00:00
parent 5e84e80024
commit dfecfdb23e
1 changed files with 1 additions and 1 deletions

View File

@ -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);