summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-10-04 15:23:55 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-10-04 15:23:55 (GMT)
commit7fd9f4b458dcc6416ccbc9731889a765f5df7960 (patch)
tree9be95f753e1825c5a20906e050796f8b5198ca30 /Lib
parent09f3d080fe0cadab0db6380c58dd4968db20287d (diff)
parent8f657c35b978b681e6e919f08358992e1aed7dc1 (diff)
downloadcpython-7fd9f4b458dcc6416ccbc9731889a765f5df7960.zip
cpython-7fd9f4b458dcc6416ccbc9731889a765f5df7960.tar.gz
cpython-7fd9f4b458dcc6416ccbc9731889a765f5df7960.tar.bz2
Merge heads
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_weakref.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py
index 6d50a66..4cfaa54 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -845,6 +845,14 @@ class ReferencesTestCase(TestBase):
with self.assertRaises(AttributeError):
ref1.__callback__ = lambda ref: None
+ def test_callback_gcs(self):
+ class ObjectWithDel(Object):
+ def __del__(self): pass
+ x = ObjectWithDel(1)
+ ref1 = weakref.ref(x, lambda ref: support.gc_collect())
+ del x
+ support.gc_collect()
+
class SubclassableWeakrefTestCase(TestBase):