Commit a69a2c71 authored by Stefan Behnel's avatar Stefan Behnel

py2.4 test fix

parent 3e310ce3
import sys
def _next(it):
if sys.version_info[0] >= 3:
return next(it)
else:
return it.next()
def test_reference_cycle_cleanup(): def test_reference_cycle_cleanup():
""" """
>>> import gc >>> import gc
>>> delegator, gen, next, deleted = test_reference_cycle_cleanup() >>> delegator, gen, deleted = test_reference_cycle_cleanup()
>>> next(delegator(gen())) >>> _next(delegator(gen()))
123 123
>>> _ = gc.collect(); print(sorted(deleted)) >>> _ = gc.collect(); print(sorted(deleted))
['bar', 'foo'] ['bar', 'foo']
...@@ -26,4 +33,4 @@ def test_reference_cycle_cleanup(): ...@@ -26,4 +33,4 @@ def test_reference_cycle_cleanup():
while True: while True:
yield 123 yield 123
return delegator, gen, next, deleted return delegator, gen, deleted
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