summaryrefslogtreecommitdiff
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-23 09:47:21 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-23 09:47:21 +0200
commitbfeec6d871e3db2e0ddfdef01387913bc19cadd4 (patch)
tree4dc6007c796426315d9667698a4e20ec93072625 /Objects/genobject.c
parent9c3975f9fe0633faf8e4ea11ccd03d5b3109498e (diff)
downloadcpython-bfeec6d871e3db2e0ddfdef01387913bc19cadd4.tar.gz
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 59f53cefcb..24a1da6f3e 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -402,8 +402,7 @@ gen_close(PyGenObject *gen, PyObject *args)
if (PyErr_ExceptionMatches(PyExc_StopIteration)
|| PyErr_ExceptionMatches(PyExc_GeneratorExit)) {
PyErr_Clear(); /* ignore these errors */
- Py_INCREF(Py_None);
- return Py_None;
+ Py_RETURN_NONE;
}
return NULL;
}