[Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.139,2.139.2.1

Jack Jansen jackjansen@users.sourceforge.net
2001年11月17日 18:04:39 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv3742/Python/Objects
Modified Files:
 Tag: r22b2-branch
	fileobject.c 
Log Message:
Make the mwerks-specific error in case of a failing fopen() use a 0 as the errno parameter, so we pass test_file.
Index: fileobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v
retrieving revision 2.139
retrieving revision 2.139.2.1
diff -C2 -d -r2.139 -r2.139.2.1
*** fileobject.c	2001年11月09日 20:59:14	2.139
--- fileobject.c	2001年11月18日 02:04:37	2.139.2.1
***************
*** 122,128 ****
 	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");
 			return NULL;
 		}
--- 122,133 ----
 	if (f->f_fp == NULL) {
 #ifdef NO_FOPEN_ERRNO
! 		/* Metroworks only, wich does not always sets errno */
 		if (errno == 0) {
! 			PyObject *v;
! 			v = Py_BuildValue("(is)", 0, "Cannot open file");
! 			if (v != NULL) {
! 				PyErr_SetObject(PyExc_IOError, v);
! 				Py_DECREF(v);
! 			}
 			return NULL;
 		}

AltStyle によって変換されたページ (->オリジナル) /