summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/test/test_zipimport.py5
-rw-r--r--Modules/zipimport.c7
2 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py
index 3c9457f..c9aff4a 100644
--- a/Lib/test/test_zipimport.py
+++ b/Lib/test/test_zipimport.py
@@ -186,6 +186,9 @@ class CompressedZipImportTestCase(UncompressedZipImportTestCase):
compression = ZIP_DEFLATED
-if __name__ == "__main__":
+def test_main():
test_support.run_unittest(UncompressedZipImportTestCase)
test_support.run_unittest(CompressedZipImportTestCase)
+
+if __name__ == "__main__":
+ test_main()
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 159a6b0..4c796f3 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -371,7 +371,7 @@ zipimporter_is_package(PyObject *obj, PyObject *args)
char *fullname;
enum module_info mi;
- if (!PyArg_ParseTuple(args, "s:zipimporter.find_module",
+ if (!PyArg_ParseTuple(args, "s:zipimporter.is_package",
&fullname))
return NULL;
@@ -947,7 +947,7 @@ normalize_line_endings(PyObject *source)
return NULL;
}
/* replace "\r\n?" by "\n" */
- for (q = buf;;) {
+ for (q = buf; *p != '\0'; p++) {
if (*p == '\r') {
*q++ = '\n';
if (*(p + 1) == '\n')
@@ -955,9 +955,6 @@ normalize_line_endings(PyObject *source)
}
else
*q++ = *p;
- if (*p == '\0')
- break;
- p++;
}
*q++ = '\n'; /* add trailing \n */
*q = '\0';