classification
Title: Use Py_RETURN_NONE in sqlite3 module
Type: enhancement Stage: resolved
Components: Extension Modules Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2016-04-01 18:37 by berker.peksag, last changed 2016-04-09 04:39 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
py_return_none_macro.diff berker.peksag, 2016-04-01 18:37 review
py_return_none_macro.cocci serhiy.storchaka, 2016-04-01 20:50
Messages (5)
msg262754 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-01 18:37
The attached patch replaces all "Py_INCREF(Py_None); return Py_None;" lines with the Py_RETURN_NONE macro in sqlite3 module.
msg262756 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-04-01 19:11
py_return_none_macro.diff looks good to me.
msg262769 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2016-04-01 20:50
This patch and more can be generated by –°occinelle [1] semantic patch.

    spatch --in-place --dir . --sp-file py_return_none_macro.cocci

But be aware that some maintainers consider such sort of changes a code churn.

[1] http://coccinelle.lip6.fr/
msg263061 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-04-09 04:34
New changeset b72f2d699563 by Berker Peksag in branch 'default':
Issue #26687: Use Py_RETURN_NONE macro in sqlite3 module
https://hg.python.org/cpython/rev/b72f2d699563
msg263062 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2016-04-09 04:39
Thanks Victor and Serhiy.

–°occinelle looks like a useful tool, but I'm not planning to touch modules that I don't know well enough.
History
Date User Action Args
2016-04-09 04:39:44berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg263062

stage: patch review -> resolved
2016-04-09 04:34:06python-devsetnosy: + python-dev
messages: + msg263061
2016-04-01 20:50:58serhiy.storchakasetfiles: + py_return_none_macro.cocci
nosy: + serhiy.storchaka
messages: + msg262769

2016-04-01 19:11:24vstinnersetnosy: + vstinner
messages: + msg262756
2016-04-01 18:37:32berker.peksagsetfiles: + py_return_none_macro.diff
keywords: + patch
2016-04-01 18:37:10berker.peksagcreate