diff options
author | Peter Eisentraut | 2017-09-29 20:50:01 +0000 |
---|---|---|
committer | Peter Eisentraut | 2017-09-29 20:51:39 +0000 |
commit | 0008a106d4f84206a96fc1fb09a1e6b09f1627ec (patch) | |
tree | 8d6f2a3465e231550af4d17a00f80f6d5631a705 | |
parent | 19de0ab23ccba12567c18640f00b49f01471018d (diff) |
Use Py_RETURN_NONE where suitable
This is more idiomatic style and available as of Python 2.4, which is
our minimum.
-rw-r--r-- | src/pl/plpython/plpy_cursorobject.c | 3 | ||||
-rw-r--r-- | src/pl/plpython/plpy_plpymodule.c | 3 | ||||
-rw-r--r-- | 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; } |