[Python-checkins] r55732 - in python/trunk: Misc/NEWS Python/compile.c
georg.brandl
python-checkins at python.org
Fri Jun 1 13:33:39 CEST 2007
Author: georg.brandl
Date: Fri Jun 1 13:33:33 2007
New Revision: 55732
Modified:
python/trunk/Misc/NEWS
python/trunk/Python/compile.c
Log:
Bug #1722484: remove docstrings again when running with -OO.
Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS (original)
+++ python/trunk/Misc/NEWS Fri Jun 1 13:33:33 2007
@@ -12,6 +12,8 @@
Core and builtins
-----------------
+- Bug #1722484: remove docstrings again when running with -OO.
+
- Add new attribute names for function objects. All the func_* become
__*__ attributes. (Some already existed, e.g., __doc__ and __name__.)
Modified: python/trunk/Python/compile.c
==============================================================================
--- python/trunk/Python/compile.c (original)
+++ python/trunk/Python/compile.c Fri Jun 1 13:33:33 2007
@@ -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))
More information about the Python-checkins
mailing list