From: Victor Stinner Date: Wed, 17 Jul 2013 23:54:37 +0000 (+0200) Subject: Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call X-Git-Tag: v3.4.0a1~154 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4abda5d5b08f5ed09f4c72e7ba9726f89aaf8780;p=python Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call type_call() with an exception set --- diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c index 49994158db..8f9bd699a6 100644 --- a/Modules/_sqlite/cursor.c +++ b/Modules/_sqlite/cursor.c @@ -339,6 +339,11 @@ PyObject* _pysqlite_fetch_one_row(pysqlite_Cursor* self) if (self->connection->text_factory == (PyObject*)&PyUnicode_Type) { converted = PyUnicode_FromStringAndSize(val_str, nbytes); 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); if (!colname) { colname = "";