8000 Use Py_RETURN_NONE where suitable · dirbacke/postgres@0008a10 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0008a10

Browse files
committed
Use Py_RETURN_NONE where suitable
This is more idiomatic style and available as of Python 2.4, which is our minimum.
1 parent 19de0ab commit 0008a10

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

src/pl/plpython/plpy_cursorobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,5 @@ PLy_cursor_close(PyObject *self, PyObject *unused)
509509
cursor->closed = true;
510510
}
511511

512-
Py_INCREF(Py_None);
513-
return Py_None;
512+
Py_RETURN_NONE;
514513
}

src/pl/plpython/plpy_plpymodule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,5 @@ PLy_output(volatile int level, PyObject *self, PyObject *args, PyObject *kw)
575575
/*
576576
* return a legal object so the interpreter will continue on its merry way
577577
*/
578-
Py_INCREF(Py_None);
579-
return Py_None;
578+
Py_RETURN_NONE;
580579
}

src/pl/plpython/plpy_subxactobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,5 @@ PLy_subtransaction_exit(PyObject *self, PyObject *args)
212212
CurrentResourceOwner = subxactdata->oldowner;
213213
pfree(subxactdata);
214214

215-
Py_INCREF(Py_None);
216-
return Py_None;
215+
Py_RETURN_NONE;
217216
}

0 commit comments

Comments
 (0)
0