mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #24257: Fixed incorrect uses of PyObject_IsInstance().
Fixed segmentation fault in sqlite3.Row constructor with faked cursor type. Fixed system error in the comparison of faked types.SimpleNamespace.
This commit is contained in:
commit
e79ec70801
6 changed files with 36 additions and 8 deletions
|
@ -46,7 +46,7 @@ pysqlite_row_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
|
|||
if (!PyArg_ParseTuple(args, "OO", &cursor, &data))
|
||||
return NULL;
|
||||
|
||||
if (!PyObject_IsInstance((PyObject*)cursor, (PyObject*)&pysqlite_CursorType)) {
|
||||
if (!PyObject_TypeCheck((PyObject*)cursor, &pysqlite_CursorType)) {
|
||||
PyErr_SetString(PyExc_TypeError, "instance of cursor required for first argument");
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue