From 0008a106d4f84206a96fc1fb09a1e6b09f1627ec Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Fri, 29 Sep 2017 16:50:01 -0400 Subject: [PATCH] Use Py_RETURN_NONE where suitable This is more idiomatic style and available as of Python 2.4, which is our minimum. --- src/pl/plpython/plpy_cursorobject.c | 3 +-- src/pl/plpython/plpy_plpymodule.c | 3 +-- src/pl/plpython/plpy_subxactobject.c | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pl/plpython/plpy_cursorobject.c b/src/pl/plpython/plpy_cursorobject.c index 2ad663cf66..0108471bfe 100644 --- a/src/pl/plpython/plpy_cursorobject.c +++ b/src/pl/plpython/plpy_cursorobject.c @@ -509,6 +509,5 @@ PLy_cursor_close(PyObject *self, PyObject *unused) cursor->closed = true; } - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } diff --git a/src/pl/plpython/plpy_plpymodule.c b/src/pl/plpython/plpy_plpymodule.c index feaf203256..759ad44932 100644 --- a/src/pl/plpython/plpy_plpymodule.c +++ b/src/pl/plpython/plpy_plpymodule.c @@ -575,6 +575,5 @@ PLy_output(volatile int level, PyObject *self, PyObject *args, PyObject *kw) /* * return a legal object so the interpreter will continue on its merry way */ - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } diff --git a/src/pl/plpython/plpy_subxactobject.c b/src/pl/plpython/plpy_subxactobject.c index 9f1caa87d9..331d2b859c 100644 --- a/src/pl/plpython/plpy_subxactobject.c +++ b/src/pl/plpython/plpy_subxactobject.c @@ -212,6 +212,5 @@ PLy_subtransaction_exit(PyObject *self, PyObject *args) CurrentResourceOwner = subxactdata->oldowner; pfree(subxactdata); - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } -- 2.40.0