Mercurial > cpython-lru_cache-weakref
diff Mac/Modules/macmodule.c @ 21113:ed3dce17fc79 legacy-trunk
Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the
changes from start of branch upto r22b2 were already merged, of course).
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Fri, 30 Nov 2001 14:16:36 +0000 |
| parents | af3673812e33 |
| children | 91dd223829c6 |
line wrap: on
line diff
--- a/Mac/Modules/macmodule.c Fri Nov 30 07:23:05 2001 +0000 +++ b/Mac/Modules/macmodule.c Fri Nov 30 14:16:36 2001 +0000 @@ -114,14 +114,12 @@ char *getbootvol(void); -static PyObject *MacError; /* Exception mac.error */ - /* Set a MAC-specific error from errno, and return NULL */ static PyObject * mac_error() { - return PyErr_SetFromErrno(MacError); + return PyErr_SetFromErrno(PyExc_OSError); } /* MAC generic methods */ @@ -295,8 +293,7 @@ #endif Py_END_ALLOW_THREADS if (res == NULL) { - PyErr_SetString(MacError, path); - return NULL; + return mac_error(); } return PyString_FromString(res); } @@ -839,8 +836,7 @@ return; /* Initialize mac.error exception */ - MacError = PyErr_NewException("mac.error", NULL, NULL); - PyDict_SetItemString(d, "error", MacError); + PyDict_SetItemString(d, "error", PyExc_OSError); PyStructSequence_InitType(&StatResultType, &stat_result_desc); PyDict_SetItemString(d, "stat_result", (PyObject*) &StatResultType);
