diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2006-06-15 04:54:29 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2006-06-15 04:54:29 +0000 |
commit | fe7d0c3bc6352bbabd4b458bf736cd18e9082a27 (patch) | |
tree | c5a985fb771c7a4f5cb943dd2b3f145922bef7f4 | |
parent | 5d538b603f733cd747ce5a776d86fd971012c986 (diff) | |
download | cpython-git-fe7d0c3bc6352bbabd4b458bf736cd18e9082a27.tar.gz |
Speculative checkin (requires approval of Gerhard Haering)
This backs out the test changes in 46962 which prevented crashes
by not running the tests via a version check. All the version checks
added in that rev were removed from the tests.
Code was added to the error handler in connection.c that seems
to work with older versions of sqlite including 3.1.3.
-rw-r--r-- | Lib/sqlite3/test/hooks.py | 2 | ||||
-rw-r--r-- | Lib/sqlite3/test/userfunctions.py | 10 | ||||
-rw-r--r-- | Modules/_sqlite/connection.c | 2 |
3 files changed, 2 insertions, 12 deletions
diff --git a/Lib/sqlite3/test/hooks.py b/Lib/sqlite3/test/hooks.py index 7deab983f8..b10b3efb17 100644 --- a/Lib/sqlite3/test/hooks.py +++ b/Lib/sqlite3/test/hooks.py @@ -48,8 +48,6 @@ class CollationTests(unittest.TestCase): pass def CheckCollationIsUsed(self): - if sqlite.version_info < (3, 2, 1): # old SQLite versions crash on this test - return def mycoll(x, y): # reverse order return -cmp(x, y) diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py index 587d39c876..215178c023 100644 --- a/Lib/sqlite3/test/userfunctions.py +++ b/Lib/sqlite3/test/userfunctions.py @@ -200,8 +200,6 @@ class FunctionTests(unittest.TestCase): self.failUnlessEqual(val, buffer("blob")) def CheckFuncException(self): - if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions - return cur = self.con.cursor() try: cur.execute("select raiseexception()") @@ -285,8 +283,6 @@ class AggregateTests(unittest.TestCase): self.failUnlessEqual(e.args[0], "AggrNoStep instance has no attribute 'step'") def CheckAggrNoFinalize(self): - if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions - return cur = self.con.cursor() try: cur.execute("select nofinalize(t) from test") @@ -296,8 +292,6 @@ class AggregateTests(unittest.TestCase): self.failUnlessEqual(e.args[0], "user-defined aggregate's 'finalize' method raised error") def CheckAggrExceptionInInit(self): - if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions - return cur = self.con.cursor() try: cur.execute("select excInit(t) from test") @@ -307,8 +301,6 @@ class AggregateTests(unittest.TestCase): self.failUnlessEqual(e.args[0], "user-defined aggregate's '__init__' method raised error") def CheckAggrExceptionInStep(self): - if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions - return cur = self.con.cursor() try: cur.execute("select excStep(t) from test") @@ -318,8 +310,6 @@ class AggregateTests(unittest.TestCase): self.failUnlessEqual(e.args[0], "user-defined aggregate's 'step' method raised error") def CheckAggrExceptionInFinalize(self): - if sqlite.version_info < (3, 3, 3): # don't raise bug in earlier SQLite versions - return cur = self.con.cursor() try: cur.execute("select excFinalize(t) from test") diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index f63d88c21d..ca7aad84ec 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -42,6 +42,8 @@ void _sqlite3_result_error(sqlite3_context* ctx, const char* errmsg, int len) * segfaults, depending on the SQLite version */ #if SQLITE_VERSION_NUMBER >= 3003003 sqlite3_result_error(ctx, errmsg, len); +#else + PyErr_SetString(OperationalError, errmsg); #endif } |