diff Python/compile.c @ 41931:fec1296544ab 2.5

Bug #1722484: remove docstrings again when running with -OO. (backport from rev. 55732)
author Georg Brandl <georg@python.org>
date Fri, 01 Jun 2007 11:33:45 +0000
parents be68da561dcd
children 692493771ae3
line wrap: on
line diff
--- a/Python/compile.c	Wed May 30 07:07:34 2007 +0000
+++ b/Python/compile.c	Fri Jun 01 11:33:45 2007 +0000
@@ -1779,7 +1779,8 @@
 	if (!asdl_seq_LEN(stmts))
 		return 1;
 	st = (stmt_ty)asdl_seq_GET(stmts, 0);
-	if (compiler_isdocstring(st)) {
+	if (compiler_isdocstring(st) && Py_OptimizeFlag < 2) {
+		/* don't generate docstrings if -OO */
 		i = 1;
 		VISIT(c, expr, st->v.Expr.value);
 		if (!compiler_nameop(c, __doc__, Store))