Skip to content

Commit bf92fbf

Browse files
authored
Remove unneccesary code in the example
The creation of types and add them to module may not be required in this example, since the example tries to highlight the use of exceptions.
1 parent 3c9d560 commit bf92fbf

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

doc/sphinx/source/exceptions.rst

+1-7
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,11 @@ Often you need to create an Exception class that is specialised to a particular
155155
{
156156
PyObject* m;
157157
158-
noddy_NoddyType.tp_new = PyType_GenericNew;
159-
if (PyType_Ready(&noddy_NoddyType) < 0)
160-
return NULL;
161-
162158
m = PyModule_Create(&noddymodule);
163159
if (m == NULL)
164160
return NULL;
165161
166-
Py_INCREF(&noddy_NoddyType);
167-
PyModule_AddObject(m, "Noddy", (PyObject *)&noddy_NoddyType);
168-
162+
169163
/* Initialise exceptions here.
170164
*
171165
* Firstly a base class exception that inherits from the builtin Exception.

0 commit comments

Comments
 (0)