mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
PL/Python: Remove workaround for returning booleans in Python <2.3
Since Python 2.2 is no longer supported, we can now use Py_RETURN_TRUE and Py_RETURN_FALSE instead of the old workaround.
This commit is contained in:
parent
db0af74af2
commit
be0dfbad36
@ -492,15 +492,9 @@ PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup)
|
|||||||
static PyObject *
|
static PyObject *
|
||||||
PLyBool_FromBool(PLyDatumToOb *arg, Datum d)
|
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))
|
if (DatumGetBool(d))
|
||||||
return PyBool_FromLong(1);
|
Py_RETURN_TRUE;
|
||||||
return PyBool_FromLong(0);
|
Py_RETURN_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
Loading…
Reference in New Issue
Block a user