Skip to content

Commit c334b3a

Browse files
committed
Added documentation for PyErr_SetFromErrnoWithFilename().
1 parent c79ac00 commit c334b3a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Doc/api/api.tex

+10
Original file line numberDiff line numberDiff line change
@@ -934,6 +934,16 @@ \chapter{Exception Handling \label{exceptionHandling}}
934934
error.
935935
\end{cfuncdesc}
936936

937+
\begin{cfuncdesc}{PyObject*}{PyErr_SetFromErrnoWithFilename}{PyObject *type,
938+
char *filename}
939+
Similar to \cfunction{PyErr_SetFromErrno()}, with the additional
940+
behavior that if \var{filename} is not \NULL, it is passed to the
941+
constructor of \var{type} as a third parameter. In the case of
942+
exceptions such as \exception{IOError} and \exception{OSError}, this
943+
is used to define the \member{filename} attribute of the exception
944+
instance.
945+
\end{cfuncdesc}
946+
937947
\begin{cfuncdesc}{void}{PyErr_BadInternalCall}{}
938948
This is a shorthand for \samp{PyErr_SetString(PyExc_TypeError,
939949
\var{message})}, where \var{message} indicates that an internal

0 commit comments

Comments
 (0)