From: Raymond Hettinger Date: Sun, 29 Dec 2002 17:16:49 +0000 (+0000) Subject: Demonstrate use of PyType_Ready() in the example. X-Git-Tag: v2.3c1~2853 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3c736f1a415fd87fece57756a836f5e06ff2af73;p=thirdparty%2FPython%2Fcpython.git Demonstrate use of PyType_Ready() in the example. --- diff --git a/Modules/xxmodule.c b/Modules/xxmodule.c index 4b8822cfc5b2..501de86f68c4 100644 --- a/Modules/xxmodule.c +++ b/Modules/xxmodule.c @@ -235,9 +235,11 @@ initxx(void) { PyObject *m; - /* Initialize the type of the new type object here; doing it here - * is required for portability to Windows without requiring C++. */ - Xxo_Type.ob_type = &PyType_Type; + /* Finalize the type object including setting type of the new type + * object; doing it here is required for portability to Windows + * without requiring C++. */ + if (PyType_Ready(&Xxo_Type) < 0) + return; /* Create the module and add the functions */ m = Py_InitModule3("xx", xx_methods, module_doc);