}
-static PyObject *PosixError; /* Exception posix.error */
-
/* Set a POSIX-specific error from errno, and return NULL */
static PyObject *
posix_error()
{
- return PyErr_SetFromErrno(PosixError);
+ return PyErr_SetFromErrno(PyExc_OSError);
}
static PyObject *
posix_error_with_filename(name)
char* name;
{
- return PyErr_SetFromErrnoWithFilename(PosixError, name);
+ return PyErr_SetFromErrnoWithFilename(PyExc_OSError, name);
}
v = Py_BuildValue("(is)", code, text);
if (v != NULL) {
- PyErr_SetObject(PosixError, v);
+ PyErr_SetObject(PyExc_OSError, v);
Py_DECREF(v);
}
return NULL; /* Signal to Python that an Exception is Pending */
if (all_ins(d))
return;
- Py_INCREF(PyExc_OSError);
- PosixError = PyExc_OSError;
- PyDict_SetItemString(d, "error", PosixError);
+ PyDict_SetItemString(d, "error", PyExc_OSError);
}