summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Heller <theller@ctypes.org>2002-07-02 15:47:03 (GMT)
committerThomas Heller <theller@ctypes.org>2002-07-02 15:47:03 (GMT)
commit4f2722ac9b2a481dff1059416c9fa903d002153c (patch)
treeedb46cd414b8a8a428b4b93052b96376e94f81b4
parentb28467b7137fe5f43f024f8d479a25c45f9f640a (diff)
downloadcpython-4f2722ac9b2a481dff1059416c9fa903d002153c.zip
cpython-4f2722ac9b2a481dff1059416c9fa903d002153c.tar.gz
cpython-4f2722ac9b2a481dff1059416c9fa903d002153c.tar.bz2
Docs for PyErr_SetFromWindowsErrWithFilename() and
PyErr_SetFromWindowsErr(). Fixes SF# 576016, with additional markup.
-rw-r--r--Doc/api/exceptions.tex23
1 files changed, 23 insertions, 0 deletions
diff --git a/Doc/api/exceptions.tex b/Doc/api/exceptions.tex
index 5bd9117..57ba8b8 100644
--- a/Doc/api/exceptions.tex
+++ b/Doc/api/exceptions.tex
@@ -193,6 +193,29 @@ for each thread.
instance.
\end{cfuncdesc}
+\begin{cfuncdesc}{PyObject*}{PyErr_SetFromWindowsErr}{int ierr}
+ This is a convenience function to raise
+ \exception{PyExc_WindowsError}. If called with \var{ierr} of
+ \cdata{0}, the error code returned by a call to
+ \cfunction{GetLastError()} is used instead. It calls the win32
+ function \cfunction{FormatMessage()} to retrieve the Windows
+ description of error code \var{ierr}, then it constructs a tuple object
+ whose first item is the integer \cdata{ierr} value and whose second
+ item is the corresponding error message (gotten from
+ \cfunction{FormatMessage()}), and then calls
+ \samp{PyErr_SetObject(\var{PyExc_WindowsError}, \var{object})}.
+ This function always returns \NULL. This function is only available
+ on Windows.
+\end{cfuncdesc}
+
+\begin{cfuncdesc}{PyObject*}{PyErr_SetFromWindowsErrWithFilename}{int ierr,
+ char *filename}
+ Similar to \cfunction{PyErr_SetFromWindowsErr()}, with the
+ additional behavior that if \var{filename} is not \NULL, it is
+ passed to the constructor of \exception{WindowsError} as a third
+ parameter. This function is only available on Windows.
+\end{cfuncdesc}
+
\begin{cfuncdesc}{void}{PyErr_BadInternalCall}{}
This is a shorthand for \samp{PyErr_SetString(PyExc_TypeError,
\var{message})}, where \var{message} indicates that an internal