diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index e9a50574751..3616642a2ff 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -1776,6 +1776,8 @@ order (MRO) for bases """ # Safety test for __cmp__ def unsafecmp(a, b): + if not hasattr(a.__class__, "__cmp__"): + return try: a.__class__.__cmp__(a, b) except TypeError: