Skip to content

Commit 75096b3

Browse files
committed
bpo-33443 Fix typo in Python/import.c (GH-6721)
1 parent 2a363d2 commit 75096b3

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
In the method, "_PyImportZip_Init(void)", of Python/import.c, the variable, "PyObject \*path_hooks, \*zimpimport;", seems to be typo, which can be "zipimport".
2+
Modified "zimpimport" to "zipimport" in L. 95, 107, 108, 115, 117 of Python/import.c.

Python/import.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ _PyImportHooks_Init(void)
9292
_PyInitError
9393
_PyImportZip_Init(void)
9494
{
95-
PyObject *path_hooks, *zimpimport;
95+
PyObject *path_hooks, *zipimport;
9696
int err = 0;
9797

9898
path_hooks = PySys_GetObject("path_hooks");
@@ -104,17 +104,17 @@ _PyImportZip_Init(void)
104104
if (Py_VerboseFlag)
105105
PySys_WriteStderr("# installing zipimport hook\n");
106106

107-
zimpimport = PyImport_ImportModule("zipimport");
108-
if (zimpimport == NULL) {
107+
zipimport = PyImport_ImportModule("zipimport");
108+
if (zipimport == NULL) {
109109
PyErr_Clear(); /* No zip import module -- okay */
110110
if (Py_VerboseFlag)
111111
PySys_WriteStderr("# can't import zipimport\n");
112112
}
113113
else {
114114
_Py_IDENTIFIER(zipimporter);
115-
PyObject *zipimporter = _PyObject_GetAttrId(zimpimport,
115+
PyObject *zipimporter = _PyObject_GetAttrId(zipimport,
116116
&PyId_zipimporter);
117-
Py_DECREF(zimpimport);
117+
Py_DECREF(zipimport);
118118
if (zipimporter == NULL) {
119119
PyErr_Clear(); /* No zipimporter object -- okay */
120120
if (Py_VerboseFlag)

0 commit comments

Comments
 (0)