diff options
author | Raymond Hettinger <python@rcn.com> | 2002-12-29 17:16:49 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2002-12-29 17:16:49 (GMT) |
commit | 3c736f1a415fd87fece57756a836f5e06ff2af73 (patch) | |
tree | c12ba76551e8b9001334a472b247682af5b4bb43 /Modules | |
parent | 8c6e0ec16a39bb4ae139ec0104f6615173244664 (diff) | |
download | cpython-3c736f1a415fd87fece57756a836f5e06ff2af73.zip cpython-3c736f1a415fd87fece57756a836f5e06ff2af73.tar.gz cpython-3c736f1a415fd87fece57756a836f5e06ff2af73.tar.bz2 |
Demonstrate use of PyType_Ready() in the example.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/xxmodule.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Modules/xxmodule.c b/Modules/xxmodule.c index 4b8822c..501de86 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); |