summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index c18d5e7..b4fbd32 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -308,7 +308,9 @@ int PyObject_AsWriteBuffer(PyObject *obj,
int
PyNumber_Check(PyObject *o)
{
- return o && o->ob_type->tp_as_number;
+ return o && o->ob_type->tp_as_number &&
+ (o->ob_type->tp_as_number->nb_int ||
+ o->ob_type->tp_as_number->nb_float);
}
/* Binary operators */