From patchwork Sun May 21 06:02:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [1, of, 3] cext: move back finalization of dirstateTupleType where it should be From: Yuya Nishihara X-Patchwork-Id: 20781 Message-Id: <429ef6c0fa3c16ff776c.1495346522@mimosa> To: mercurial-devel@mercurial-scm.org Date: Sun, 21 May 2017 15:02:02 +0900 # HG changeset patch # User Yuya Nishihara # Date 1495341087 -32400 # Sun May 21 13:31:27 2017 +0900 # Node ID 429ef6c0fa3c16ff776cd6aeff27d2f27c2fc7d3 # Parent b9942bc6b292aa9b16ad80fceb765dab4f1c777c 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);