Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbe0dfba

Browse files
committed
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_TRUEand Py_RETURN_FALSE instead of the old workaround.
1 parentdb0af74 commitbe0dfba

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

‎src/pl/plpython/plpy_typeio.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -492,15 +492,9 @@ PLy_input_datum_func2(PLyDatumToOb *arg, Oid typeOid, HeapTuple typeTup)
492492
staticPyObject*
493493
PLyBool_FromBool(PLyDatumToOb*arg,Datumd)
494494
{
495-
/*
496-
* We would like to use Py_RETURN_TRUE and Py_RETURN_FALSE here for
497-
* generating SQL from trigger functions, but those are only supported in
498-
* Python >= 2.3, and we support older versions.
499-
* http://docs.python.org/api/boolObjects.html
500-
*/
501495
if (DatumGetBool(d))
502-
returnPyBool_FromLong(1);
503-
returnPyBool_FromLong(0);
496+
Py_RETURN_TRUE;
497+
Py_RETURN_FALSE;
504498
}
505499

506500
staticPyObject*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp