]> granicus.if.org Git - python/commitdiff
Fix #1169: remove docstrings in functions for -OO.
authorGeorg Brandl <georg@python.org>
Wed, 19 Sep 2007 06:37:19 +0000 (06:37 +0000)
committerGeorg Brandl <georg@python.org>
Wed, 19 Sep 2007 06:37:19 +0000 (06:37 +0000)
Python/compile.c

index eed13792d288fa5e0173f08790ca12c8623af112..193d52076ab0b591fd92f386e01f1ba97627420a 100644 (file)
@@ -1336,7 +1336,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);