summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut2012-09-29 16:55:42 +0000
committerPeter Eisentraut2012-09-29 16:55:42 +0000
commitbe0dfbad3671ed2503a2a661e70b48c5b364e069 (patch)
tree698d636f15fe2305fefd45ece176d189105e2649 /src
parentdb0af74af28663e060e8c5d6f8dd0927bb572f25 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpython/plpy_typeio.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/pl/plpython/plpy_typeio.c b/src/pl/plpython/plpy_typeio.c
index 0ad542f21e9..74da5180f1b 100644
--- a/src/pl/plpython/plpy_typeio.c
+++ b/src/pl/plpython/plpy_typeio.c
@@ -492,15 +492,9 @@ PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup)
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 *