From: Georg Brandl Date: Wed, 13 Jul 2011 13:59:24 +0000 (+0200) Subject: Clarify that PyErr_NewException creates an exception *class*, not instance. X-Git-Tag: v2.7.3rc1~618 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fbe84d92ab0be0dbfc3f8f16b8fd53d8373ba37c;p=thirdparty%2FPython%2Fcpython.git Clarify that PyErr_NewException creates an exception *class*, not instance. --- diff --git a/Doc/c-api/exceptions.rst b/Doc/c-api/exceptions.rst index 8b1e8fc7fb96..a0011458bac9 100644 --- a/Doc/c-api/exceptions.rst +++ b/Doc/c-api/exceptions.rst @@ -352,10 +352,10 @@ is a separate error indicator for each thread. .. cfunction:: PyObject* PyErr_NewException(char *name, PyObject *base, PyObject *dict) - This utility function creates and returns a new exception object. The *name* + This utility function creates and returns a new exception class. The *name* argument must be the name of the new exception, a C string of the form - ``module.class``. The *base* and *dict* arguments are normally *NULL*. This - creates a class object derived from :exc:`Exception` (accessible in C as + ``module.classname``. The *base* and *dict* arguments are normally *NULL*. + This creates a class object derived from :exc:`Exception` (accessible in C as :cdata:`PyExc_Exception`). The :attr:`__module__` attribute of the new class is set to the first part (up