summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-01-28 15:08:09 +0000
committerGuido van Rossum <guido@python.org>1999-01-28 15:08:09 +0000
commit3b4af52a958190de87a870c3e9082ca8acbb74e3 (patch)
tree15c884362014851411a13e053038f38acd46dcd9 /Python/compile.c
parent9bc1498e68f33b1d8f3d65bb2f8ae296b5457fc0 (diff)
downloadcpython-3b4af52a958190de87a870c3e9082ca8acbb74e3.tar.gz
Implement -OO; "unsafe" optimization that removes docstrings.
Marc-Andre Lemburg.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 4cdc26f521..1e937e492a 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;