diff options
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 |