]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Implement -OO; "unsafe" optimization that removes docstrings.
authorGuido van Rossum <guido@python.org>
Thu, 28 Jan 1999 15:08:09 +0000 (15:08 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 28 Jan 1999 15:08:09 +0000 (15:08 +0000)
Marc-Andre Lemburg.

Python/compile.c

index 4cdc26f521cc6f708d6637485e3c3958e71db8b8..1e937e492abf0cdc2901c77ac4ae6be12272fc79 100644 (file)
@@ -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;