diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-01-27 18:17:45 +0000 |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-01-27 18:17:45 +0000 |
commit | e3fa6230b8872e08cad4bb558395aff059ce6c5a (patch) | |
tree | 248ab67be63fc3bdf77f7cd4a0b5d8de72c973ac /Lib/sqlite3 | |
parent | a827877ca57ed8844c0c226f08d8e2edb8376676 (diff) | |
download | cpython-e3fa6230b8872e08cad4bb558395aff059ce6c5a.tar.gz |
Issue #1717: Remove cmp. Stage 1: remove all uses of cmp and __cmp__ from
the standard library and tests.
Diffstat (limited to 'Lib/sqlite3')
-rw-r--r-- | Lib/sqlite3/test/hooks.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py index 6872fd6e9c..c15c7bee72 100644 --- a/Lib/sqlite3/test/hooks.py +++ b/Lib/sqlite3/test/hooks.py @@ -42,7 +42,7 @@ class CollationTests(unittest.TestCase): def CheckCreateCollationNotAscii(self): con = sqlite.connect(":memory:") try: - con.create_collation("collä", cmp) + con.create_collation("collä", lambda x, y: (x > y) - (x < y)) self.fail("should have raised a ProgrammingError") except sqlite.ProgrammingError as e: pass @@ -52,7 +52,7 @@ class CollationTests(unittest.TestCase): return def mycoll(x, y): # reverse order - return -cmp(x, y) + return -((x > y) - (x < y)) con = sqlite.connect(":memory:") con.create_collation("mycoll", mycoll) @@ -82,8 +82,8 @@ class CollationTests(unittest.TestCase): Verify that the last one is actually used. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) - con.create_collation("mycoll", lambda x, y: -cmp(x, y)) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) + con.create_collation("mycoll", lambda x, y: -((x > y) - (x < y))) result = con.execute(""" select x from (select 'a' as x union select 'b' as x) order by x collate mycoll """).fetchall() @@ -96,7 +96,7 @@ class CollationTests(unittest.TestCase): to use it. """ con = sqlite.connect(":memory:") - con.create_collation("mycoll", cmp) + con.create_collation("mycoll", lambda x, y: (x > y) - (x < y)) con.create_collation("mycoll", None) try: con.execute("select 'a' as x union select 'b' as x order by x collate mycoll") |