Merge heads

This commit is contained in:
Serhiy Storchaka 2016-10-04 18:23:55 +03:00
commit 7fd9f4b458
3 changed files with 23 additions and 12 deletions

View file

@ -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):