[py3] Fixed dispatch tests
This commit is contained in:
parent
27192564c3
commit
60f5e10230
|
@ -149,9 +149,11 @@ class BoundMethodWeakref(object):
|
||||||
self.selfName,
|
self.selfName,
|
||||||
self.funcName,
|
self.funcName,
|
||||||
)
|
)
|
||||||
|
|
||||||
__repr__ = __str__
|
__repr__ = __str__
|
||||||
|
|
||||||
|
__hash__ = object.__hash__
|
||||||
|
|
||||||
def __bool__( self ):
|
def __bool__( self ):
|
||||||
"""Whether we are still a valid reference"""
|
"""Whether we are still a valid reference"""
|
||||||
return self() is not None
|
return self() is not None
|
||||||
|
|
|
@ -54,10 +54,8 @@ class SaferefTests(unittest.TestCase):
|
||||||
sd[s] = 1
|
sd[s] = 1
|
||||||
for t in self.ts:
|
for t in self.ts:
|
||||||
if hasattr(t, 'x'):
|
if hasattr(t, 'x'):
|
||||||
self.assertTrue(sd.has_key(safeRef(t.x)))
|
|
||||||
self.assertTrue(safeRef(t.x) in sd)
|
self.assertTrue(safeRef(t.x) in sd)
|
||||||
else:
|
else:
|
||||||
self.assertTrue(sd.has_key(safeRef(t)))
|
|
||||||
self.assertTrue(safeRef(t) in sd)
|
self.assertTrue(safeRef(t) in sd)
|
||||||
|
|
||||||
def testRepresentation(self):
|
def testRepresentation(self):
|
||||||
|
|
Loading…
Reference in New Issue