]> granicus.if.org Git - postgresql/commitdiff
Use Py_RETURN_NONE where suitable
authorPeter Eisentraut <peter_e@gmx.net>
Fri, 29 Sep 2017 20:50:01 +0000 (16:50 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Fri, 29 Sep 2017 20:51:39 +0000 (16:51 -0400)
This is more idiomatic style and available as of Python 2.4, which is
our minimum.

src/pl/plpython/plpy_cursorobject.c
src/pl/plpython/plpy_plpymodule.c
src/pl/plpython/plpy_subxactobject.c

index 2ad663cf6618c106b6dfb8f1778e450f2b1d0474..0108471bfe218ccfd46d42208ef07a95a546339d 100644 (file)
@@ -509,6 +509,5 @@ PLy_cursor_close(PyObject *self, PyObject *unused)
                cursor->closed = true;
        }
 
-       Py_INCREF(Py_None);
-       return Py_None;
+       Py_RETURN_NONE;
 }
index feaf2032560863cfa8c69d7980e9bd16026ef406..759ad449323caeb0c866c03967fda33c6dbdc722 100644 (file)
@@ -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;
 }
index 9f1caa87d9411e6f56cbc3f5a48a4b105346f4fd..331d2b859c0eedb92e4a594aac909cd0ab48bc70 100644 (file)
@@ -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;
 }