[pypy-commit] pypy stdlib-2.7.4: fix sqlite3 AuthorizerTests

bdkearns noreply at buildbot.pypy.org
Wed Apr 10 06:33:30 CEST 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: stdlib-2.7.4
Changeset: r63190:7f1b3bcda3a5
Date: 2013-04-10 00:31 -0400
http://bitbucket.org/pypy/pypy/changeset/7f1b3bcda3a5/

Log:	fix sqlite3 AuthorizerTests

diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -785,7 +785,10 @@
                            "const char*, const char*)")
             def authorizer(userdata, action, arg1, arg2, dbname, source):
                 try:
-                    return int(callback(action, arg1, arg2, dbname, source))
+                    ret = callback(action, arg1, arg2, dbname, source)
+                    assert isinstance(ret, int)
+                    assert ret in (_lib.SQLITE_OK, _lib.SQLITE_DENY, _lib.SQLITE_IGNORE)
+                    return ret
                 except Exception:
                     return _lib.SQLITE_DENY
             self.__func_cache[callback] = authorizer


More information about the pypy-commit mailing list