Since Python 2.2 is no longer supported, we can now use Py_RETURN_TRUE
and Py_RETURN_FALSE instead of the old workaround.
static PyObject *
PLyBool_FromBool(PLyDatumToOb *arg, Datum d)
{
- /*
- * We would like to use Py_RETURN_TRUE and Py_RETURN_FALSE here for
- * generating SQL from trigger functions, but those are only supported in
- * Python >= 2.3, and we support older versions.
- * http://docs.python.org/api/boolObjects.html
- */
if (DatumGetBool(d))
- return PyBool_FromLong(1);
- return PyBool_FromLong(0);
+ Py_RETURN_TRUE;
+ Py_RETURN_FALSE;
}
static PyObject *