diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-11-30 14:16:36 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-11-30 14:16:36 (GMT) |
commit | b3be216b41a4755556a887baa6ab440279fbe1dc (patch) | |
tree | f7b1e40f24563a9800d31b517cac615c991b0d09 /Objects/fileobject.c | |
parent | 69b83b113f9e6fed321288ea23bca2aa673a7beb (diff) | |
download | cpython-b3be216b41a4755556a887baa6ab440279fbe1dc.zip cpython-b3be216b41a4755556a887baa6ab440279fbe1dc.tar.gz cpython-b3be216b41a4755556a887baa6ab440279fbe1dc.tar.bz2 |
Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
changes from start of branch upto r22b2 were already merged, of course).
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r-- | Objects/fileobject.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index a60d3ef..27612f4 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -121,9 +121,14 @@ open_the_file(PyFileObject *f, char *name, char *mode) } if (f->f_fp == NULL) { #ifdef NO_FOPEN_ERRNO - /* Metroworks only, not testable, so unchanged */ + /* Metroworks only, wich does not always sets errno */ if (errno == 0) { - PyErr_SetString(PyExc_IOError, "Cannot open file"); + PyObject *v; + v = Py_BuildValue("(is)", 0, "Cannot open file"); + if (v != NULL) { + PyErr_SetObject(PyExc_IOError, v); + Py_DECREF(v); + } return NULL; } #endif |