diff Python/compile.c @ 9987:b7bcc2cda1b3 legacy-trunk

Implement -OO; "unsafe" optimization that removes docstrings. Marc-Andre Lemburg.
author Guido van Rossum <guido@python.org>
date Thu, 28 Jan 1999 15:08:09 +0000
parents 98a6fc6877ae
children ccdf5dc2acf6
line wrap: on
line diff
--- a/Python/compile.c	Thu Jan 28 15:07:47 1999 +0000
+++ b/Python/compile.c	Thu Jan 28 15:08:09 1999 +0000
@@ -2646,6 +2646,9 @@
 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;