diff options
Diffstat (limited to 'Objects/namespaceobject.c')
-rw-r--r-- | Objects/namespaceobject.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Objects/namespaceobject.c b/Objects/namespaceobject.c index 720ac0d..3d27a95 100644 --- a/Objects/namespaceobject.c +++ b/Objects/namespaceobject.c @@ -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; } |