summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-01-28 15:08:09 (GMT)
committerGuido van Rossum <guido@python.org>1999-01-28 15:08:09 (GMT)
commit541563ec7e853bacf12f83bab7a55b0d0ec5b3ee (patch)
treeabfe6826d7158e9a70c66b9643cc7005aab21116
parent6b86a42c7f8786f8446d5a48db406282f18ec06a (diff)
downloadcpython-541563ec7e853bacf12f83bab7a55b0d0ec5b3ee.zip
cpython-541563ec7e853bacf12f83bab7a55b0d0ec5b3ee.tar.gz
cpython-541563ec7e853bacf12f83bab7a55b0d0ec5b3ee.tar.bz2
Implement -OO; "unsafe" optimization that removes docstrings.
Marc-Andre Lemburg.
-rw-r--r--Python/compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4cdc26f..1e937e4 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -2646,6 +2646,9 @@ static PyObject *
get_docstring(n)
node *n;
{
+ /* Don't generate doc-strings if run with -OO */
+ if (Py_OptimizeFlag > 1)
+ return NULL;
n = get_rawdocstring(n);
if (n == NULL)
return NULL;