Commit 82894739 authored by Kevin Modzelewski's avatar Kevin Modzelewski

Workaround our generator-abandonment leak

parent 39770523
# expected: reffail
print any(i == 5 for i in xrange(10))
# expected: reffail
import weakref
def doStuff():
......@@ -33,5 +32,5 @@ for i in xrange(5):
import gc
gc.collect()
assert any(r() is None for r in l2), "object was not collected"
assert any(w() is None for w in l1), "object was not collected"
assert any([r() is None for r in l2]), "object was not collected"
assert any([w() is None for w in l1]), "object was not collected"
# expected: reffail
# Make sure we can support weakrefs on extension objects.
# The _sre.SRE_Pattern type is one of the few builtin types that supports weakrefs natively.
......@@ -19,4 +18,4 @@ for i in xrange(5):
import gc
gc.collect()
assert any(r() is None for r in l)
assert any([r() is None for r in l])
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