Skip to content

Commit 2ad2ce7

Browse files
committed
Resolve deprecation warning
See [1] for more info. [1] python/cpython#79893 Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent af21da2 commit 2ad2ce7

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
@@ -269,8 +269,10 @@ def _reset(self):
269269

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

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

0 commit comments

Comments
 (0)