]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use PyType_Ready() for initialization of the ob_type field of our
authorGuido van Rossum <guido@python.org>
Mon, 17 Dec 2001 17:25:53 +0000 (17:25 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 17 Dec 2001 17:25:53 +0000 (17:25 +0000)
types (the tp_base field must be initialized prior to that call).

Modules/xxsubtype.c

index e4910c1abcfb50b06b356f98c367366d180cc878..d10840947a5dcf303fe46be2cb83e05e820d3bbf 100644 (file)
@@ -242,11 +242,13 @@ initxxsubtype(void)
 
        /* Fill in the deferred data addresses.  This must be done before
           PyType_Ready() is called. */
-       spamdict_type.ob_type = &PyType_Type;
        spamdict_type.tp_base = &PyDict_Type;
+       if (PyType_Ready(&spamdict_type) < 0)
+               return;
 
-       spamlist_type.ob_type = &PyType_Type;
        spamlist_type.tp_base = &PyList_Type;
+       if (PyType_Ready(&spamlist_type) < 0)
+               return;
 
        m = Py_InitModule3("xxsubtype",
                           xxsubtype_functions,