diff options
author | Guido van Rossum <guido@python.org> | 2001-12-17 17:25:53 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2001-12-17 17:25:53 (GMT) |
commit | a7b9b3ccba6f48a11cb2ee8f55d53696ed7b4697 (patch) | |
tree | 387190bf1b336f10f4e0766cdfb74b7ef54e02ca /Modules | |
parent | 8efd6ceecc2dfc8186e957ccdb6319f1c721672b (diff) | |
download | cpython-a7b9b3ccba6f48a11cb2ee8f55d53696ed7b4697.zip cpython-a7b9b3ccba6f48a11cb2ee8f55d53696ed7b4697.tar.gz cpython-a7b9b3ccba6f48a11cb2ee8f55d53696ed7b4697.tar.bz2 |
Use PyType_Ready() for initialization of the ob_type field of our
types (the tp_base field must be initialized prior to that call).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/xxsubtype.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/xxsubtype.c b/Modules/xxsubtype.c index e4910c1..d108409 100644 --- a/Modules/xxsubtype.c +++ b/Modules/xxsubtype.c @@ -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, |