summaryrefslogtreecommitdiffstats
path: root/Modules/zipimport.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2017-01-23 07:47:21 (GMT)
commit228b12edcce49649d6befa3c03dbcefd5a22ae76 (patch)
tree1066be6909fb981fcf30e1a8e224d43567bd9b92 /Modules/zipimport.c
parent60e6e962bac6a668d0df539ebf526a0a1c69eacd (diff)
downloadcpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.zip
cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.gz
cpython-228b12edcce49649d6befa3c03dbcefd5a22ae76.tar.bz2
Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r--Modules/zipimport.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 950e4f4..18777b2 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