Commit 30d67e5a authored by Dag Sverre Seljebotn's avatar Dag Sverre Seljebotn

Fixed iterator raising exception bug.

Simply a typo in NextNode...
parent 03cdb738
......@@ -1197,7 +1197,7 @@ class NextNode(AtomicExprNode):
code.putln(
"if (!%s) {" %
self.result_code)
code.error_goto_if_PyErr(self.pos)
code.putln(code.error_goto_if_PyErr(self.pos))
code.putln("break;")
code.putln("}")
code.putln("}")
......
__doc__ = """
>>> f()
"""
class IteratorAndIterateable:
def next(self):
raise ValueError("")
def __iter__(self):
return self
def f():
try:
for x in IteratorAndIterateable():
pass
assert False, "Should not reach this point, iterator has thrown exception"
except ValueError:
pass
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment