[Python-checkins] CVS: python/dist/src/Mac/Modules macmodule.c,1.48,1.48.2.1

Jack Jansen jackjansen@users.sourceforge.net
Sat, 17 Nov 2001 18:03:24 -0800


Update of /cvsroot/python/python/dist/src/Mac/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv3561/Python/Mac/Modules

Modified Files:
      Tag: r22b2-branch
	macmodule.c 
Log Message:
For obscure historical reasons mac.error was not the same as OSError.
Fixed.

Index: macmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macmodule.c,v
retrieving revision 1.48
retrieving revision 1.48.2.1
diff -C2 -d -r1.48 -r1.48.2.1
*** macmodule.c	2001/11/06 12:10:05	1.48
--- macmodule.c	2001/11/18 02:03:22	1.48.2.1
***************
*** 115,120 ****
  
  
- static PyObject *MacError; /* Exception mac.error */
- 
  /* Set a MAC-specific error from errno, and return NULL */
  
--- 115,118 ----
***************
*** 122,126 ****
  mac_error() 
  {
! 	return PyErr_SetFromErrno(MacError);
  }
  
--- 120,124 ----
  mac_error() 
  {
! 	return PyErr_SetFromErrno(PyExc_OSError);
  }
  
***************
*** 296,301 ****
  	Py_END_ALLOW_THREADS
  	if (res == NULL) {
! 		PyErr_SetString(MacError, path);
! 		return NULL;
  	}
  	return PyString_FromString(res);
--- 294,298 ----
  	Py_END_ALLOW_THREADS
  	if (res == NULL) {
! 		return mac_error();
  	}
  	return PyString_FromString(res);
***************
*** 840,845 ****
  
  	/* Initialize mac.error exception */
! 	MacError = PyErr_NewException("mac.error", NULL, NULL);
! 	PyDict_SetItemString(d, "error", MacError);
  
  	PyStructSequence_InitType(&StatResultType, &stat_result_desc);
--- 837,841 ----
  
  	/* Initialize mac.error exception */
! 	PyDict_SetItemString(d, "error", PyExc_OSError);
  
  	PyStructSequence_InitType(&StatResultType, &stat_result_desc);