diff options
-rw-r--r-- | Objects/object.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c index 04a7c1f..1283294 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -998,7 +998,10 @@ PyObject_RichCompareBool(PyObject *v, PyObject *w, int op) if (res == NULL) return -1; - ok = PyObject_IsTrue(res); + if (PyBool_Check(res)) + ok = (res == Py_True); + else + ok = PyObject_IsTrue(res); Py_DECREF(res); return ok; } |