Author: Brian Kearns <[email protected]>
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
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit