summaryrefslogtreecommitdiffstats
path: root/Doc/c-api
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-12-28 08:34:58 (GMT)
committerGeorg Brandl <georg@python.org>2009-12-28 08:34:58 (GMT)
commit740cdc3a9f9593ee1fe86d751c70b8505d6a19c9 (patch)
tree4c34f7bec409dfb040cba93c2064b37bb71b2b95 /Doc/c-api
parent02e7dfde639498064b137be7cb850c4229f0c8fb (diff)
downloadcpython-740cdc3a9f9593ee1fe86d751c70b8505d6a19c9.zip
cpython-740cdc3a9f9593ee1fe86d751c70b8505d6a19c9.tar.gz
cpython-740cdc3a9f9593ee1fe86d751c70b8505d6a19c9.tar.bz2
#7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new exceptions a docstring.
Diffstat (limited to 'Doc/c-api')
-rw-r--r--Doc/c-api/exceptions.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index ba18af1..474478c 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -433,6 +433,15 @@ is a separate error indicator for each thread.
argument can be used to specify a dictionary of class variables and methods.
+.. cfunction:: PyObject* PyErr_NewExceptionWithDoc(char *name, char *doc, PyObject *base, PyObject *dict)
+
+ Same as :cfunc:`PyErr_NewException`, except that the new exception class can
+ easily be given a docstring: If *doc* is non-*NULL*, it will be used as the
+ docstring for the exception class.
+
+ .. versionadded:: 2.7
+
+
.. cfunction:: void PyErr_WriteUnraisable(PyObject *obj)
This utility function prints a warning message to ``sys.stderr`` when an