summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_weakref.py
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2001-10-18 18:06:05 (GMT)
committerFred Drake <fdrake@acm.org>2001-10-18 18:06:05 (GMT)
commit39c27f1ffbb426bc7aceb7258b6d20cb5d4ba392 (patch)
treed6c5f35b1e1527b559fd62fb8c74780d28ca1b41 /Lib/test/test_weakref.py
parent73006d02374e785c660f15bad0aabcf197d97ce8 (diff)
downloadcpython-39c27f1ffbb426bc7aceb7258b6d20cb5d4ba392.zip
cpython-39c27f1ffbb426bc7aceb7258b6d20cb5d4ba392.tar.gz
cpython-39c27f1ffbb426bc7aceb7258b6d20cb5d4ba392.tar.bz2
Make sure we do not core dump when using proxies with the binary slot
handlers. This was fixed in Objects/weakrefobject.c 1.2.
Diffstat (limited to 'Lib/test/test_weakref.py')
-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 5dfa6ce..5e56717 100644
--- a/Lib/test/test_weakref.py
+++ b/Lib/test/test_weakref.py
@@ -216,6 +216,14 @@ class ReferencesTestCase(TestBase):
self.assert_(weakref.getweakrefs(o) == [ref1],
"list of refs does not match")
+ def test_newstyle_number_ops(self):
+ class F(float):
+ pass
+ f = F(2.0)
+ p = weakref.proxy(f)
+ self.assert_(p + 1.0 == 3.0)
+ self.assert_(1.0 + p == 3.0) # this used to SEGV
+
class Object:
def __init__(self, arg):