Commit 4abda5d5 authored by Victor Stinner's avatar Victor Stinner

Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call

type_call() with an exception set
parent ace47d7e
...@@ -339,6 +339,11 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self) ...@@ -339,6 +339,11 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self)
if (self->connection->text_factory == (PyObject*)&PyUnicode_Type) { if (self->connection->text_factory == (PyObject*)&PyUnicode_Type) {
converted = PyUnicode_FromStringAndSize(val_str, nbytes); converted = PyUnicode_FromStringAndSize(val_str, nbytes);
if (!converted) { if (!converted) {
#ifdef Py_DEBUG
/* in debug mode, type_call() fails with an assertion
error if an exception is set when it is called */
PyErr_Clear();
#endif
colname = sqlite3_column_name(self->statement->st, i); colname = sqlite3_column_name(self->statement->st, i);
if (!colname) { if (!colname) {
colname = "<unknown column name>"; colname = "<unknown column name>";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment