Commit b0a4fa4a authored by Stefan Behnel's avatar Stefan Behnel

yet another Py2.5 fix

parent b612885e
...@@ -9,10 +9,17 @@ see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/YieldFrom-Pyt ...@@ -9,10 +9,17 @@ see <http://www.cosc.canterbury.ac.nz/greg.ewing/python/yield-from/YieldFrom-Pyt
import sys import sys
try:
_next = next # not in Py<=2.5
except NameError:
def _next(it):
return it.next()
def _lines(trace): def _lines(trace):
for line in trace: for line in trace:
print(line) print(line)
def test_delegation_of_initial_next_to_subgenerator(): def test_delegation_of_initial_next_to_subgenerator():
""" """
>>> _lines(test_delegation_of_initial_next_to_subgenerator()) >>> _lines(test_delegation_of_initial_next_to_subgenerator())
...@@ -1006,8 +1013,6 @@ def test_delegating_generators_claim_to_be_running_close(): ...@@ -1006,8 +1013,6 @@ def test_delegating_generators_claim_to_be_running_close():
return ret return ret
_next = next # keep it around for Py<=2.5
def yield_in_return(x): def yield_in_return(x):
""" """
>>> x = yield_in_return(range(3)) >>> x = yield_in_return(range(3))
......
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