fp = _Py_fopen(archive_obj, "rb");
if (fp == NULL) {
- PyErr_Format(ZipImportError, "can't open Zip file: '%U'", archive_obj);
+ if (!PyErr_Occurred())
+ PyErr_Format(ZipImportError, "can't open Zip file: '%U'", archive_obj);
return NULL;
}
fseek(fp, -22, SEEK_END);
fp = _Py_fopen(archive, "rb");
if (!fp) {
- PyErr_Format(PyExc_IOError,
- "zipimport: can not open file %U", archive);
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_IOError,
+ "zipimport: can not open file %U", archive);
return NULL;
}