diff options
author | Raymond Hettinger <python@rcn.com> | 2003-06-30 04:18:48 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-06-30 04:18:48 (GMT) |
commit | d693a81595ae3c617f5dd20f9a8bf8b7f130683b (patch) | |
tree | 9b967125a07413622eac5ed8b65933c378b9cdf5 /Lib/test/test_weakref.py | |
parent | 562a855da062202e0af39cb290c3baf7228dc350 (diff) | |
download | cpython-d693a81595ae3c617f5dd20f9a8bf8b7f130683b.zip cpython-d693a81595ae3c617f5dd20f9a8bf8b7f130683b.tar.gz cpython-d693a81595ae3c617f5dd20f9a8bf8b7f130683b.tar.bz2 |
Fix SF 762891: "del p[key]" on proxy object raises SystemError()
Diffstat (limited to 'Lib/test/test_weakref.py')
-rw-r--r-- | Lib/test/test_weakref.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_weakref.py b/Lib/test/test_weakref.py index 5969f35..1b450a3 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) |