Author: David Schneider <[email protected]>
Branch: release-2.1.x
Changeset: r65423:371a517e6484
Date: 2013-07-17 10:55 +0200
http://bitbucket.org/pypy/pypy/changeset/371a517e6484/
Log: import updated _cffi_backend/test/_backend_test_c.py
diff --git a/pypy/module/_cffi_backend/test/_backend_test_c.py
b/pypy/module/_cffi_backend/test/_backend_test_c.py
--- a/pypy/module/_cffi_backend/test/_backend_test_c.py
+++ b/pypy/module/_cffi_backend/test/_backend_test_c.py
@@ -2760,6 +2760,20 @@
assert wr() is None
py.test.raises(RuntimeError, from_handle, cast(BCharP, 0))
+def test_new_handle_cycle():
+ import _weakref
+ BVoidP = new_pointer_type(new_void_type())
+ class A(object):
+ pass
+ o = A()
+ o.cycle = newp_handle(BVoidP, o)
+ wr = _weakref.ref(o)
+ del o
+ for i in range(3):
+ if wr() is not None:
+ import gc; gc.collect()
+ assert wr() is None
+
def _test_bitfield_details(flag):
BChar = new_primitive_type("char")
BShort = new_primitive_type("short")
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit