Skip to content
This repository was archived by the owner on Nov 17, 2020. It is now read-only.

Commit 62992af

Browse files
author
gvanrossum
committed
Use PyType_Ready() for initialization of the ob_type field of our
types (the tp_base field must be initialized prior to that call). git-svn-id: http://svn.python.org/projects/python/trunk@24787 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent 9e897f2 commit 62992af

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Modules/xxsubtype.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,13 @@ initxxsubtype(void)
242242

243243
/* Fill in the deferred data addresses. This must be done before
244244
PyType_Ready() is called. */
245-
spamdict_type.ob_type = &PyType_Type;
246245
spamdict_type.tp_base = &PyDict_Type;
246+
if (PyType_Ready(&spamdict_type) < 0)
247+
return;
247248

248-
spamlist_type.ob_type = &PyType_Type;
249249
spamlist_type.tp_base = &PyList_Type;
250+
if (PyType_Ready(&spamlist_type) < 0)
251+
return;
250252

251253
m = Py_InitModule3("xxsubtype",
252254
xxsubtype_functions,

0 commit comments

Comments
 (0)