Patch #1352711: make zipimport raise a complete IOError
This commit is contained in:
parent
2a8ec996ce
commit
e9b1949f70
|
@ -434,8 +434,7 @@ zipimporter_get_data(PyObject *obj, PyObject *args)
|
|||
|
||||
toc_entry = PyDict_GetItemString(self->files, path);
|
||||
if (toc_entry == NULL) {
|
||||
PyErr_Format(PyExc_IOError, "file not found [%.200s]",
|
||||
path);
|
||||
PyErr_SetFromErrnoWithFilename(PyExc_IOError, path);
|
||||
return NULL;
|
||||
}
|
||||
return get_data(PyString_AsString(self->archive), toc_entry);
|
||||
|
|
Loading…
Reference in New Issue