diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2021-03-03 14:16:24 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-03 14:16:24 (GMT) |
commit | 3b4b2cf418707c79f96689e401e3c703c0fdd4d2 (patch) | |
tree | 9b6feb5cc3c352f360c575ca90b986ab50d08ee0 /Modules | |
parent | 09605ad7269c8d9828fa3c175ad7c9efe8d12762 (diff) | |
download | cpython-3b4b2cf418707c79f96689e401e3c703c0fdd4d2.zip cpython-3b4b2cf418707c79f96689e401e3c703c0fdd4d2.tar.gz cpython-3b4b2cf418707c79f96689e401e3c703c0fdd4d2.tar.bz2 |
bpo-43368: Fix fetching empty bytes in sqlite3 (GH-24706)
Regression introduced in 47feb1feb28631b6647699b7633109aa85340966.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_sqlite/cursor.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 23ab745..764eec5 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -333,12 +333,8 @@ _pysqlite_fetch_one_row(pysqlite_Cursor* self) } else { /* coltype == SQLITE_BLOB */ const char *blob = sqlite3_column_blob(self->statement->st, i); - if (!blob) { - converted = Py_NewRef(Py_None); - } else { - nbytes = sqlite3_column_bytes(self->statement->st, i); - converted = PyBytes_FromStringAndSize(blob, nbytes); - } + nbytes = sqlite3_column_bytes(self->statement->st, i); + converted = PyBytes_FromStringAndSize(blob, nbytes); } } |