summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index c8e9ddc..a18bb78 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -945,16 +945,14 @@ PyNumber_Index(PyObject *item)
PyObject *result = NULL;
if (item == NULL)
return null_error();
- /* XXX(nnorwitz): should these be CheckExact? Aren't subclasses ok? */
- if (PyInt_CheckExact(item) || PyLong_CheckExact(item)) {
+ if (PyInt_Check(item) || PyLong_Check(item)) {
Py_INCREF(item);
return item;
}
if (PyIndex_Check(item)) {
result = item->ob_type->tp_as_number->nb_index(item);
- /* XXX(nnorwitz): Aren't subclasses ok here too? */
if (result &&
- !PyInt_CheckExact(result) && !PyLong_CheckExact(result)) {
+ !PyInt_Check(result) && !PyLong_Check(result)) {
PyErr_Format(PyExc_TypeError,
"__index__ returned non-(int,long) " \
"(type %.200s)",