[Python-checkins] r76854 - python/branches/release26-maint/Lib/test/test_descr.py

benjamin.peterson python-checkins at python.org
Wed Dec 16 05:27:27 CET 2009


Author: benjamin.peterson
Date: Wed Dec 16 05:27:27 2009
New Revision: 76854

Log:
backport change from trunk

Modified:
   python/branches/release26-maint/Lib/test/test_descr.py

Modified: python/branches/release26-maint/Lib/test/test_descr.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_descr.py	(original)
+++ python/branches/release26-maint/Lib/test/test_descr.py	Wed Dec 16 05:27:27 2009
@@ -1776,6 +1776,8 @@
 
         # Safety test for __cmp__
         def unsafecmp(a, b):
+            if not hasattr(a.__class__, "__cmp__"):
+                return
             try:
                 a.__class__.__cmp__(a, b)
             except TypeError:


More information about the Python-checkins mailing list