diff options
author | Raymond Hettinger <python@rcn.com> | 2017-02-06 07:15:57 -0800 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2017-02-06 07:15:57 -0800 |
commit | 826745ba953b4ef23462fb0bc2d7b3db23b51d89 (patch) | |
tree | 7789cc87df07c2786c40e6888cbb532a94ce6334 /Modules/zipimport.c | |
parent | 95b272b4e0d5438a12702e51e05d03f5a5a8e505 (diff) | |
parent | 515f1cf20f4e9656b1bcda236bad8ed0e33770f0 (diff) | |
download | cpython-826745ba953b4ef23462fb0bc2d7b3db23b51d89.tar.gz |
merge
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r-- | Modules/zipimport.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 59046aaae4..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, @@ -998,13 +997,13 @@ read_directory(PyObject *archive) goto file_error; } name[name_size] = '\0'; /* Add terminating null byte */ - if (SEP != '/') { - for (i = 0; i < name_size; i++) { - if (name[i] == '/') { - name[i] = SEP; - } +#if SEP != '/' + for (i = 0; i < name_size; i++) { + if (name[i] == '/') { + name[i] = SEP; } } +#endif /* Skip the rest of the header. * On Windows, calling fseek to skip over the fields we don't use is * slower than reading the data because fseek flushes stdio's @@ -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 |