From 228b12edcce49649d6befa3c03dbcefd5a22ae76 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Mon, 23 Jan 2017 09:47:21 +0200 Subject: Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever possible. Patch is writen with Coccinelle. --- Modules/zipimport.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'Modules/zipimport.c') diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 950e4f4a28..18777b2a1d 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -677,8 +677,7 @@ zipimporter_get_source(PyObject *obj, PyObject *args) } /* we have the module, but no source */ - Py_INCREF(Py_None); - return Py_None; + Py_RETURN_NONE; } PyDoc_STRVAR(doc_find_module, @@ -1284,8 +1283,7 @@ unmarshal_code(PyObject *pathname, PyObject *data, time_t mtime) PySys_FormatStderr("# %R has bad magic\n", pathname); } - Py_INCREF(Py_None); - return Py_None; /* signal caller to try alternative */ + Py_RETURN_NONE; /* signal caller to try alternative */ } if (mtime != 0 && !eq_mtime(get_uint32(buf + 4), mtime)) { @@ -1293,8 +1291,7 @@ unmarshal_code(PyObject *pathname, PyObject *data, time_t mtime) PySys_FormatStderr("# %R has bad mtime\n", pathname); } - Py_INCREF(Py_None); - return Py_None; /* signal caller to try alternative */ + Py_RETURN_NONE; /* signal caller to try alternative */ } /* XXX the pyc's size field is ignored; timestamp collisions are probably -- cgit v1.2.1