From: Guido van Rossum Date: Thu, 28 Jan 1999 15:08:09 +0000 (+0000) Subject: Implement -OO; "unsafe" optimization that removes docstrings. X-Git-Tag: v1.5.2b2~241 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=541563ec7e853bacf12f83bab7a55b0d0ec5b3ee;p=thirdparty%2FPython%2Fcpython.git Implement -OO; "unsafe" optimization that removes docstrings. Marc-Andre Lemburg. --- diff --git a/Python/compile.c b/Python/compile.c index 4cdc26f521cc..1e937e492abf 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;