mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Issue #23571: PyObject_Call(), PyCFunction_Call() and call_function() now
raise a SystemError if a function returns a result and raises an exception. The SystemError is chained to the previous exception. Refactor also PyObject_Call() and PyCFunction_Call() to make them more readable. Remove some checks which became useless (duplicate checks). Change reviewed by Serhiy Storchaka.
This commit is contained in:
parent
d81431f587
commit
4a7cc88472
7 changed files with 129 additions and 100 deletions
|
|
@ -334,11 +334,7 @@ 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