[Python-checkins] r46964 - in python/trunk: Lib/sqlite3/test/hooks.py Lib/sqlite3/test/userfunctions.py Modules/_sqlite/connection.c

neal.norwitz python-checkins at python.org
Thu Jun 15 06:54:32 CEST 2006


Author: neal.norwitz
Date: Thu Jun 15 06:54:29 2006
New Revision: 46964

Modified:
   python/trunk/Lib/sqlite3/test/hooks.py
   python/trunk/Lib/sqlite3/test/userfunctions.py
   python/trunk/Modules/_sqlite/connection.c
Log:
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.


Modified: python/trunk/Lib/sqlite3/test/hooks.py
==============================================================================
--- python/trunk/Lib/sqlite3/test/hooks.py	(original)
+++ python/trunk/Lib/sqlite3/test/hooks.py	Thu Jun 15 06:54:29 2006
@@ -48,8 +48,6 @@
             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)

Modified: python/trunk/Lib/sqlite3/test/userfunctions.py
==============================================================================
--- python/trunk/Lib/sqlite3/test/userfunctions.py	(original)
+++ python/trunk/Lib/sqlite3/test/userfunctions.py	Thu Jun 15 06:54:29 2006
@@ -200,8 +200,6 @@
         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 @@
             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 @@
             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 @@
             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 @@
             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")

Modified: python/trunk/Modules/_sqlite/connection.c
==============================================================================
--- python/trunk/Modules/_sqlite/connection.c	(original)
+++ python/trunk/Modules/_sqlite/connection.c	Thu Jun 15 06:54:29 2006
@@ -42,6 +42,8 @@
      * segfaults, depending on the SQLite version */
 #if SQLITE_VERSION_NUMBER >= 3003003
     sqlite3_result_error(ctx, errmsg, len);
+#else
+    PyErr_SetString(OperationalError, errmsg);
 #endif
 }
 


More information about the Python-checkins mailing list