mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Issue #18408: Fix _pysqlite_fetch_one_row(), in debug mode, don't call
type_call() with an exception set
This commit is contained in:
parent
ace47d7efd
commit
4abda5d5b0
1 changed files with 5 additions and 0 deletions
|
|
@ -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>";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue