[Python-checkins] python/dist/src/Python errors.c,2.70,2.71
theller@users.sourceforge.net
theller@users.sourceforge.net
Mon, 29 Jul 2002 07:27:43 -0700
Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv15771/Python
Modified Files:
errors.c
Log Message:
New functions for extension writers on Windows:
PyErr_SetExcFromWindowsErr(), PyErr_SetExcFromWindowsErrWithFilename().
Similar to PyErr_SetFromWindowsErrWithFilename() and
PyErr_SetFromWindowsErr(), but they allow to specify
the exception type to raise. Available on Windows.
See SF patch #576458.
Index: errors.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v
retrieving revision 2.70
retrieving revision 2.71
diff -C2 -d -r2.70 -r2.71
*** errors.c 30 Jun 2002 15:26:10 -0000 2.70
--- errors.c 29 Jul 2002 14:27:41 -0000 2.71
***************
*** 338,342 ****
#ifdef MS_WINDOWS
/* Windows specific error code handling */
! PyObject *PyErr_SetFromWindowsErrWithFilename(
int ierr,
const char *filename)
--- 338,343 ----
#ifdef MS_WINDOWS
/* Windows specific error code handling */
! PyObject *PyErr_SetExcFromWindowsErrWithFilename(
! PyObject *exc,
int ierr,
const char *filename)
***************
*** 367,371 ****
v = Py_BuildValue("(is)", err, s);
if (v != NULL) {
! PyErr_SetObject(PyExc_WindowsError, v);
Py_DECREF(v);
}
--- 368,372 ----
v = Py_BuildValue("(is)", err, s);
if (v != NULL) {
! PyErr_SetObject(exc, v);
Py_DECREF(v);
}
***************
*** 374,380 ****
}
PyObject *PyErr_SetFromWindowsErr(int ierr)
{
! return PyErr_SetFromWindowsErrWithFilename(ierr, NULL);
}
#endif /* MS_WINDOWS */
--- 375,394 ----
}
+ PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr)
+ {
+ return PyErr_SetExcFromWindowsErrWithFilename(exc, ierr, NULL);
+ }
+
PyObject *PyErr_SetFromWindowsErr(int ierr)
{
! return PyErr_SetExcFromWindowsErrWithFilename(PyExc_WindowsError,
! ierr, NULL);
! }
! PyObject *PyErr_SetFromWindowsErrWithFilename(
! int ierr,
! const char *filename)
! {
! return PyErr_SetExcFromWindowsErrWithFilename(PyExc_WindowsError,
! ierr, filename);
}
#endif /* MS_WINDOWS */