diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-12-19 16:38:03 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-12-19 16:38:03 +0100 |
commit | cb1f74ec405b81dd1319b616829dd576a48603f8 (patch) | |
tree | 99573ccb27a730f4eec2cf0b6b131823668738b6 /Modules | |
parent | cac23a50ee2979b8c2e3472e6b13efb1a8bd4f78 (diff) | |
download | cpython-git-cb1f74ec405b81dd1319b616829dd576a48603f8.tar.gz |
Issue #20026: Fix the sqlite module to handle correctly invalid isolation level
(wrong type).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_sqlite/connection.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 451ea241bd..8cf2d6aa80 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -109,7 +109,10 @@ int pysqlite_connection_init(pysqlite_Connection* self, PyObject* args, PyObject Py_INCREF(isolation_level); } self->isolation_level = NULL; - pysqlite_connection_set_isolation_level(self, isolation_level); + if (pysqlite_connection_set_isolation_level(self, isolation_level) < 0) { + Py_DECREF(isolation_level); + return -1; + } Py_DECREF(isolation_level); self->statement_cache = (pysqlite_Cache*)PyObject_CallFunction((PyObject*)&pysqlite_CacheType, "Oi", self, cached_statements); |