summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/zipimport.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c
index 373255d..fa4380c 100644
--- a/Modules/zipimport.c
+++ b/Modules/zipimport.c
@@ -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);