summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-07-17 23:54:37 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-07-17 23:54:37 (GMT)
commit4abda5d5b08f5ed09f4c72e7ba9726f89aaf8780 (patch)
tree709114c2967d225e97c0738047ac7771bc08864b /Modules
parentace47d7efd2e2ab708fdc25936e9a8f85e08b6d3 (diff)
downloadcpython-4abda5d5b08f5ed09f4c72e7ba9726f89aaf8780.zip
cpython-4abda5d5b08f5ed09f4c72e7ba9726f89aaf8780.tar.gz
cpython-4abda5d5b08f5ed09f4c72e7ba9726f89aaf8780.tar.bz2
Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call
type_call() with an exception set
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sqlite/cursor.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_sqlite/cursor.c b/Modules/_sqlite/cursor.c
index 4999415..8f9bd69 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 = "<unknown column name>";