Bug #1722485 reports that Py 2.5+ doesn't ignore docstrings anymore if
used with -OO.

Attached patch should fix this.

Georg
Index: Python/compile.c
===================================================================
--- Python/compile.c	(Revision 55526)
+++ Python/compile.c	(Arbeitskopie)
@@ -1119,7 +1119,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))
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to