[pypy-svn] pypy default: Changed exception in create_function to act like CPython. Fixed error in sqlite test userfunctions CheckFuncErrorOnCreate

ademan commits-noreply at bitbucket.org
Mon Mar 7 11:14:08 CET 2011


Author: Daniel Roberts <Ademan555 at gmail.com>
Branch: 
Changeset: r42455:0656676831d1
Date: 2011-03-07 02:13 -0800
http://bitbucket.org/pypy/pypy/changeset/0656676831d1/

Log:	Changed exception in create_function to act like CPython. Fixed
	error in sqlite test userfunctions CheckFuncErrorOnCreate

diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -546,7 +546,7 @@
         self._check_closed()
         try:
             c_closure, _ = self.func_cache[callback]
-        except KeyError:            
+        except KeyError:
             def closure(context, nargs, c_params):
                 function_callback(callback, context, nargs, c_params)
             c_closure = FUNC(closure)
@@ -557,7 +557,7 @@
                                              cast(None, STEP),
                                              cast(None, FINAL))
         if ret != SQLITE_OK:
-            raise self._get_exception(ret)
+            raise self.OperationalError("Error creating function")
 
     def create_aggregate(self, name, num_args, cls):
         self._check_thread()


More information about the Pypy-commit mailing list