summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/fileobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index d43f113..d3b9894 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -137,13 +137,14 @@ PyFile_FromString(name, mode)
}
if (f->f_fp == NULL) {
#ifdef NO_FOPEN_ERRNO
+ /* Metroworks only, not testable, so unchanged */
if ( errno == 0 ) {
PyErr_SetString(PyExc_IOError, "Cannot open file");
Py_DECREF(f);
return NULL;
}
#endif
- PyErr_SetFromErrno(PyExc_IOError);
+ PyErr_SetFromErrnoWithFilename(PyExc_IOError, name);
Py_DECREF(f);
return NULL;
}