mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Make sure we do not core dump when using proxies with the binary slot
handlers. This was fixed in Objects/weakrefobject.c 1.2.
This commit is contained in:
parent
73006d0237
commit
39c27f1ffb
1 changed files with 8 additions and 0 deletions
|
@ -216,6 +216,14 @@ class ReferencesTestCase(TestBase):
|
||||||
self.assert_(weakref.getweakrefs(o) == [ref1],
|
self.assert_(weakref.getweakrefs(o) == [ref1],
|
||||||
"list of refs does not match")
|
"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:
|
class Object:
|
||||||
def __init__(self, arg):
|
def __init__(self, arg):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue