Skip to content

Commit 9c9a2ff

Browse files
committed
Resolve deprecation warning
See [1] for more info. [1] python/cpython#79893 Signed-off-by: Stephen Finucane <[email protected]>
1 parent 8f79fc7 commit 9c9a2ff

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testtools/testcase.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,10 @@ def _reset(self):
268268

269269
def __eq__(self, other):
270270
eq = getattr(unittest.TestCase, "__eq__", None)
271-
if eq is not None and not unittest.TestCase.__eq__(self, other):
272-
return False
271+
if eq is not None:
272+
eq_ = unittest.TestCase.__eq__(self, other)
273+
if eq_ is NotImplemented or not eq_:
274+
return False
273275
return self.__dict__ == getattr(other, "__dict__", None)
274276

275277
# We need to explicitly set this since we're overriding __eq__

0 commit comments

Comments
 (0)