mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +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:
parent
df9ba3623a
commit
08d230a540
6 changed files with 36 additions and 8 deletions
|
@ -164,12 +164,11 @@ namespace_clear(_PyNamespaceObject *ns)
|
|||
static PyObject *
|
||||
namespace_richcompare(PyObject *self, PyObject *other, int op)
|
||||
{
|
||||
if (PyObject_IsInstance(self, (PyObject *)&_PyNamespace_Type) &&
|
||||
PyObject_IsInstance(other, (PyObject *)&_PyNamespace_Type))
|
||||
if (PyObject_TypeCheck(self, &_PyNamespace_Type) &&
|
||||
PyObject_TypeCheck(other, &_PyNamespace_Type))
|
||||
return PyObject_RichCompare(((_PyNamespaceObject *)self)->ns_dict,
|
||||
((_PyNamespaceObject *)other)->ns_dict, op);
|
||||
Py_INCREF(Py_NotImplemented);
|
||||
return Py_NotImplemented;
|
||||
Py_RETURN_NOTIMPLEMENTED;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue