From d693a81595ae3c617f5dd20f9a8bf8b7f130683b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Mon, 30 Jun 2003 04:18:48 +0000 Subject: Fix SF 762891: "del p[key]" on proxy object raises SystemError() --- Lib/test/test_weakref.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'Lib/test/test_weakref.py') diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index 5969f3552a..1b450a364a 100644 --- a/Lib/test/test_weakref.py +++ b/Lib/test/test_weakref.py @@ -226,6 +226,17 @@ class ReferencesTestCase(TestBase): self.assert_(not hasattr(o, 'foo'), "object does not reflect attribute removal via proxy") + def test_proxy_deletion(self): + # Test clearing of SF bug #762891 + class Foo: + result = None + def __delitem__(self, accessor): + self.result = accessor + g = Foo() + f = weakref.proxy(g) + del f[0] + self.assertEqual(f.result, 0) + def test_getweakrefcount(self): o = C() ref1 = weakref.ref(o) -- cgit v1.2.1