Author: Armin Rigo <[email protected]>
Branch:
Changeset: r50875:cce139c7a9c6
Date: 2011-12-26 15:31 +0100
http://bitbucket.org/pypy/pypy/changeset/cce139c7a9c6/
Log: Fix the test.
diff --git a/pypy/translator/generator.py b/pypy/translator/generator.py
--- a/pypy/translator/generator.py
+++ b/pypy/translator/generator.py
@@ -105,12 +105,20 @@
#
mappings = [Entry]
#
+ stopblock = Block([])
+ v0 = Variable(); v1 = Variable()
+ stopblock.operations = [
+ SpaceOperation('simple_call', [Constant(StopIteration)], v0),
+ SpaceOperation('type', [v0], v1),
+ ]
+ stopblock.closeblock(Link([v1, v0], graph.exceptblock))
+ #
for block in list(graph.iterblocks()):
for exit in block.exits:
if exit.target is graph.returnblock:
- exit.args = [Constant(StopIteration),
- Constant(StopIteration())]
- exit.target = graph.exceptblock
+ exit.args = []
+ exit.target = stopblock
+ assert block is not stopblock
for index in range(len(block.operations)-1, -1, -1):
op = block.operations[index]
if op.opname == 'yield':
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit