[Python-checkins] r58205 - python/branches/release25-maint/Python/compile.c

georg.brandl python-checkins at python.org
Wed Sep 19 08:37:27 CEST 2007


Author: georg.brandl
Date: Wed Sep 19 08:37:26 2007
New Revision: 58205

Modified:
   python/branches/release25-maint/Python/compile.c
Log:
Fix #1169: remove docstrings in functions for -OO.
 (backport from rev. 58204)

Modified: python/branches/release25-maint/Python/compile.c
==============================================================================
--- python/branches/release25-maint/Python/compile.c	(original)
+++ python/branches/release25-maint/Python/compile.c	Wed Sep 19 08:37:26 2007
@@ -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);


More information about the Python-checkins mailing list