[pypy-commit] pypy py3k: cmp is gone, use direct comparison instead

antocuni noreply at buildbot.pypy.org
Fri Mar 2 10:35:48 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r53089:ff55c5b2ae11
Date: 2012-03-02 10:15 +0100
http://bitbucket.org/pypy/pypy/changeset/ff55c5b2ae11/

Log:	cmp is gone, use direct comparison instead

diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -674,10 +674,10 @@
                 for k in self.other:
                     self.failIf(k in d)
                 #cmp
-                self.assertEqual(cmp(p,p), 0)
-                self.assertEqual(cmp(d,d), 0)
-                self.assertEqual(cmp(p,d), -1)
-                self.assertEqual(cmp(d,p), 1)
+                self.assert_(p == p)
+                self.assert_(d == d)
+                self.assert_(p < d)
+                self.assert_(d > p)
                 #__non__zero__
                 if p: self.fail("Empty mapping must compare to False")
                 if not d: self.fail("Full mapping must compare to True")


More information about the pypy-commit mailing list