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.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/Lib/compiler/pyassem.py b/Lib/compiler/pyassem.py
index 0547eeb..e1fb063 100644
--- a/Lib/compiler/pyassem.py
+++ b/Lib/compiler/pyassem.py
@@ -364,16 +364,15 @@ class PyFlowGraph(FlowGraph):
def getCode(self):
"""Get a Python code object"""
- if self.stage == RAW:
- self.computeStackDepth()
- self.flattenGraph()
- if self.stage == FLAT:
- self.convertArgs()
- if self.stage == CONV:
- self.makeByteCode()
- if self.stage == DONE:
- return self.newCodeObject()
- raise RuntimeError, "inconsistent PyFlowGraph state"
+ assert self.stage == RAW
+ self.computeStackDepth()
+ self.flattenGraph()
+ assert self.stage == FLAT
+ self.convertArgs()
+ assert self.stage == CONV
+ self.makeByteCode()
+ assert self.stage == DONE
+ return self.newCodeObject()
def dump(self, io=None):
if io: