Kaydet (Commit) a5ea6890 authored tarafından Georg Brandl's avatar Georg Brandl

Bug #1722484: remove docstrings again when running with -OO.

üst 4a700bb4
...@@ -12,6 +12,8 @@ What's New in Python 2.6 alpha 1? ...@@ -12,6 +12,8 @@ What's New in Python 2.6 alpha 1?
Core and builtins Core and builtins
----------------- -----------------
- Bug #1722484: remove docstrings again when running with -OO.
- Add new attribute names for function objects. All the func_* become - Add new attribute names for function objects. All the func_* become
__*__ attributes. (Some already existed, e.g., __doc__ and __name__.) __*__ attributes. (Some already existed, e.g., __doc__ and __name__.)
......
...@@ -1119,7 +1119,8 @@ compiler_body(struct compiler *c, asdl_seq *stmts) ...@@ -1119,7 +1119,8 @@ compiler_body(struct compiler *c, asdl_seq *stmts)
if (!asdl_seq_LEN(stmts)) if (!asdl_seq_LEN(stmts))
return 1; return 1;
st = (stmt_ty)asdl_seq_GET(stmts, 0); 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; i = 1;
VISIT(c, expr, st->v.Expr.value); VISIT(c, expr, st->v.Expr.value);
if (!compiler_nameop(c, __doc__, Store)) if (!compiler_nameop(c, __doc__, Store))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment