summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/object.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 150caac..10877b5 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -633,12 +633,12 @@ default_3way_compare(PyObject *v, PyObject *w)
if (w == Py_None)
return 1;
- /* different type: compare type names */
- if (v->ob_type->tp_as_number)
+ /* different type: compare type names; numbers are smaller */
+ if (PyNumber_Check(v))
vname = "";
else
vname = v->ob_type->tp_name;
- if (w->ob_type->tp_as_number)
+ if (PyNumber_Check(w))
wname = "";
else
wname = w->ob_type->tp_name;