Issue #1717: Remove cmp.  Stage 1: remove all uses of cmp and __cmp__ from
the standard library and tests.
diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py
index 5b1aa75..67492f3 100644
--- a/Lib/test/list_tests.py
+++ b/Lib/test/list_tests.py
@@ -439,13 +439,24 @@
         self.assertRaises(TypeError, u.sort, 42, 42)
 
         def revcmp(a, b):
-            return cmp(b, a)
+            if a == b:
+                return 0
+            elif a < b:
+                return 1
+            else: # a > b
+                return -1
         u.sort(key=CmpToKey(revcmp))
         self.assertEqual(u, self.type2test([2,1,0,-1,-2]))
 
         # The following dumps core in unpatched Python 1.5:
         def myComparison(x,y):
-            return cmp(x%3, y%7)
+            xmod, ymod = x%3, y%7
+            if xmod == ymod:
+                return 0
+            elif xmod < ymod:
+                return -1
+            else: # xmod > ymod
+                return 1
         z = self.type2test(range(12))
         z.sort(key=CmpToKey(myComparison))
 
@@ -453,7 +464,12 @@
 
         def selfmodifyingComparison(x,y):
             z.append(1)
-            return cmp(x, y)
+            if x == y:
+                return 0
+            elif x < y:
+                return -1
+            else: # x > y
+                return 1
         self.assertRaises(ValueError, z.sort, key=CmpToKey(selfmodifyingComparison))
 
         self.assertRaises(TypeError, z.sort, 42, 42, 42, 42)