diff options
author | Brian Curtin <brian@python.org> | 2012-04-16 20:14:36 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2012-04-16 20:14:36 (GMT) |
commit | bd4397403783fa9b98f98e15bbb1a39d5710ee04 (patch) | |
tree | a62474d7787b8525c84d3eef3ceb74755b4d76cd /Doc | |
parent | 22a1d17bb5202337f75f684492ffbe57db84fdd3 (diff) | |
download | cpython-bd4397403783fa9b98f98e15bbb1a39d5710ee04.zip cpython-bd4397403783fa9b98f98e15bbb1a39d5710ee04.tar.gz cpython-bd4397403783fa9b98f98e15bbb1a39d5710ee04.tar.bz2 |
Add documentation for the new PyErr_SetFromImport* functions
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/exceptions.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index fd7aee7..983901a 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -229,6 +229,24 @@ in various ways. There is a separate error indicator for each thread. Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional parameter specifying the exception type to be raised. Availability: Windows. +.. c:function:: PyObject* PyErr_SetExcWithArgsKwargs(PyObject *exc, PyObject *args, PyObject *kwargs) + + This is a convenience function to set an *exc* with the given *args* and + *kwargs* values. If *args* is ``NULL``, an empty :func:`tuple` will be + created when *exc* is created via :c:func:`PyObject_Call`. + +.. c:function:: PyObject* PyErr_SetFromImportErrorWithName(PyObject *msg, PyObject *name) + + This is a convenience function to raise :exc:`ImportError`. *msg* will be + set as the exception's message string, and *name* will be set as the + :exc:`ImportError`'s ``name`` attribute. + +.. c:function:: PyObject* PyErr_SetFromImportErrorWithNameAndPath(PyObject *msg, PyObject *name, PyObject *path) + + This is a convenience function to raise :exc:`ImportError`. *msg* will be + set as the exception's message string. Both *name* and *path* will be set + as the :exc:`ImportError`'s respective ``name`` and ``path`` attributes. + .. c:function:: void PyErr_SyntaxLocationEx(char *filename, int lineno, int col_offset) |