summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-12-28 08:41:01 (GMT)
committerGeorg Brandl <georg@python.org>2009-12-28 08:41:01 (GMT)
commit1e28a27f845a59513ad3bebbd6ae19f399071bbd (patch)
tree22f39f9b43f61a56fbcca9327b968685159e7f00 /Doc
parent127d47092a98aa9b668dceb03c7b64d9c4c44adc (diff)
downloadcpython-1e28a27f845a59513ad3bebbd6ae19f399071bbd.zip
cpython-1e28a27f845a59513ad3bebbd6ae19f399071bbd.tar.gz
cpython-1e28a27f845a59513ad3bebbd6ae19f399071bbd.tar.bz2
Merged revisions 77088 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r77088 | georg.brandl | 2009-12-28 09:34:58 +0100 (Mo, 28 Dez 2009) | 1 line #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new exceptions a docstring. ........
Diffstat (limited to 'Doc')
-rw-r--r--Doc/c-api/exceptions.rst9
-rw-r--r--Doc/data/refcounts.dat6
2 files changed, 15 insertions, 0 deletions
diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst
index 25f7c11..dc9d7b1 100644
--- a/Doc/c-api/exceptions.rst
+++ b/Doc/c-api/exceptions.rst
@@ -404,6 +404,15 @@ in various ways. There 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:: 3.2
+
+
.. cfunction:: void PyErr_WriteUnraisable(PyObject *obj)
This utility function prints a warning message to ``sys.stderr`` when an
diff --git a/Doc/data/refcounts.dat b/Doc/data/refcounts.dat
index 400cf64..06e0705 100644
--- a/Doc/data/refcounts.dat
+++ b/Doc/data/refcounts.dat
@@ -281,6 +281,12 @@ PyErr_NewException:char*:name::
PyErr_NewException:PyObject*:base:0:
PyErr_NewException:PyObject*:dict:0:
+PyErr_NewExceptionWithDoc:PyObject*::+1:
+PyErr_NewExceptionWithDoc:char*:name::
+PyErr_NewExceptionWithDoc:char*:doc::
+PyErr_NewExceptionWithDoc:PyObject*:base:0:
+PyErr_NewExceptionWithDoc:PyObject*:dict:0:
+
PyErr_NoMemory:PyObject*::null:
PyErr_NormalizeException:void:::