Commit c08752f5 authored by Stefan Behnel's avatar Stefan Behnel

Py2.5 test fix

parent 78261277
......@@ -1009,12 +1009,18 @@ def test_delegating_generators_claim_to_be_running_close():
def yield_in_return(x):
"""
>>> x = yield_in_return(range(3))
>>> while True:
>>> for _ in range(10):
... try:
... print(next(x))
... except StopIteration as exc:
... print(exc.value)
... break
... except StopIteration:
... if sys.version_info >= (3,3):
... print(sys.exc_info()[1].value is None)
... else:
... print(True)
... break
0
1
2
True
"""
return (yield from x)
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