cext: move back finalization of dirstateTupleType where it should be
authorYuya Nishihara <yuya@tcha.org>
Sun, 21 May 2017 13:31:27 +0900
changeset 32384 2e5a476b2e46
parent 32382 c87db79b9507
child 32385 34bd3cd28dcb
cext: move back finalization of dirstateTupleType where it should be
mercurial/cext/parsers.c
mercurial/cext/revlog.c
--- a/mercurial/cext/parsers.c	Sat May 20 22:27:52 2017 -0700
+++ b/mercurial/cext/parsers.c	Sun May 21 13:31:27 2017 +0900
@@ -944,6 +944,8 @@
 	manifest_module_init(mod);
 	revlog_module_init(mod);
 
+	if (PyType_Ready(&dirstateTupleType) < 0)
+		return;
 	Py_INCREF(&dirstateTupleType);
 	PyModule_AddObject(mod, "dirstatetuple",
 			   (PyObject *)&dirstateTupleType);
--- a/mercurial/cext/revlog.c	Sat May 20 22:27:52 2017 -0700
+++ b/mercurial/cext/revlog.c	Sun May 21 13:31:27 2017 +0900
@@ -1930,8 +1930,7 @@
 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);