summaryrefslogtreecommitdiffstats
path: root/Lib/compiler/pyassem.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/compiler/pyassem.py')
-rw-r--r--Lib/compiler/pyassem.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/compiler/pyassem.py b/Lib/compiler/pyassem.py
index c3fa7b7..d9d294b 100644
--- a/Lib/compiler/pyassem.py
+++ b/Lib/compiler/pyassem.py
@@ -361,6 +361,10 @@ class PyFlowGraph(FlowGraph):
if flag == CO_VARARGS:
self.argcount = self.argcount - 1
+ def checkFlag(self, flag):
+ if self.flags & flag:
+ return 1
+
def setFreeVars(self, names):
self.freevars = list(names)
@@ -564,7 +568,7 @@ class PyFlowGraph(FlowGraph):
def newCodeObject(self):
assert self.stage == DONE
- if self.flags == 0:
+ if (self.flags & CO_NEWLOCALS) == 0:
nlocals = 0
else:
nlocals = len(self.varnames)
@@ -761,9 +765,6 @@ class StackDepthTracker:
('LOAD_', 1),
]
- # special cases:
- # UNPACK_SEQUENCE, BUILD_TUPLE,
- # BUILD_LIST, CALL_FUNCTION, MAKE_FUNCTION, BUILD_SLICE
def UNPACK_SEQUENCE(self, count):
return count-1
def BUILD_TUPLE(self, count):