summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-03-03 19:13:14 (GMT)
committerGuido van Rossum <guido@python.org>1997-03-03 19:13:14 (GMT)
commit8e793d925c1fa43840bc2a45292843c28a497976 (patch)
treef9ba0d19bb72e6d141a4d4d685c761e159f4788f /Python/compile.c
parent3978d75ccad1617f1b4b7055039ab2dd90b3a0d1 (diff)
downloadcpython-8e793d925c1fa43840bc2a45292843c28a497976.zip
cpython-8e793d925c1fa43840bc2a45292843c28a497976.tar.gz
cpython-8e793d925c1fa43840bc2a45292843c28a497976.tar.bz2
Add global Py_OptimizeFlag. SET_LINENO is omitted again unless this is
nonzero.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 0ee5519..b4377ec 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -59,6 +59,8 @@ PERFORMANCE OF THIS SOFTWARE.
#include <ctype.h>
#include <errno.h>
+int Py_OptimizeFlag = 0;
+
#define OP_DELETE 0
#define OP_ASSIGN 1
#define OP_APPLY 2
@@ -579,12 +581,13 @@ com_addoparg(c, op, arg)
int op;
int arg;
{
- if (op == SET_LINENO)
+ if (op == SET_LINENO) {
com_set_lineno(c, arg);
- else {
- com_addbyte(c, op);
- com_addint(c, arg);
+ if (Py_OptimizeFlag)
+ return;
}
+ com_addbyte(c, op);
+ com_addint(c, arg);
}
static void