Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8e793d9

Browse files
committed
Add global Py_OptimizeFlag. SET_LINENO is omitted again unless this is
nonzero.
1 parent 3978d75 commit 8e793d9

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

Python/compile.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ PERFORMANCE OF THIS SOFTWARE.
5959
#include <ctype.h>
6060
#include <errno.h>
6161

62+
int Py_OptimizeFlag = 0;
63+
6264
#define OP_DELETE 0
6365
#define OP_ASSIGN 1
6466
#define OP_APPLY 2
@@ -579,12 +581,13 @@ com_addoparg(c, op, arg)
579581
int op;
580582
int arg;
581583
{
582-
if (op == SET_LINENO)
584+
if (op == SET_LINENO) {
583585
com_set_lineno(c, arg);
584-
else {
585-
com_addbyte(c, op);
586-
com_addint(c, arg);
586+
if (Py_OptimizeFlag)
587+
return;
587588
}
589+
com_addbyte(c, op);
590+
com_addint(c, arg);
588591
}
589592

590593
static void

0 commit comments

Comments
 (0)