mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
bpo-45581: Raise MemoryError
in sqlite3.connect
if SQLite signals memory error (GH-29171)
This commit is contained in:
parent
b17cfd150f
commit
e2e62b3808
2 changed files with 6 additions and 0 deletions
|
@ -165,6 +165,10 @@ pysqlite_connection_init_impl(pysqlite_Connection *self,
|
|||
(uri ? SQLITE_OPEN_URI : 0), NULL);
|
||||
Py_END_ALLOW_THREADS
|
||||
|
||||
if (self->db == NULL && rc == SQLITE_NOMEM) {
|
||||
PyErr_NoMemory();
|
||||
return -1;
|
||||
}
|
||||
if (rc != SQLITE_OK) {
|
||||
_pysqlite_seterror(state, self->db);
|
||||
return -1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue