# HG changeset patch # User Yuya Nishihara # Date 2017-05-21 04:31:27 # Node ID 2e5a476b2e46c4327c24d7c25285e71d76440123 # Parent c87db79b95079c3fd0032be7a25cd41567ed11cb cext: move back finalization of dirstateTupleType where it should be diff --git a/mercurial/cext/parsers.c b/mercurial/cext/parsers.c --- a/mercurial/cext/parsers.c +++ b/mercurial/cext/parsers.c @@ -944,6 +944,8 @@ static void module_init(PyObject *mod) manifest_module_init(mod); revlog_module_init(mod); + if (PyType_Ready(&dirstateTupleType) < 0) + return; Py_INCREF(&dirstateTupleType); PyModule_AddObject(mod, "dirstatetuple", (PyObject *)&dirstateTupleType); diff --git a/mercurial/cext/revlog.c b/mercurial/cext/revlog.c --- a/mercurial/cext/revlog.c +++ b/mercurial/cext/revlog.c @@ -1930,8 +1930,7 @@ bail: void revlog_module_init(PyObject *mod) { indexType.tp_new = PyType_GenericNew; - if (PyType_Ready(&indexType) < 0 || - PyType_Ready(&dirstateTupleType) < 0) + if (PyType_Ready(&indexType) < 0) return; Py_INCREF(&indexType); PyModule_AddObject(mod, "index", (PyObject *)&indexType);