[PATCH 3 of 7] bdiff: use PYMODULEINIT

Jun Wu quark at fb.com
Mon May 8 21:07:24 EDT 2017


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1494290228 25200
#      Mon May 08 17:37:08 2017 -0700
# Node ID 04056409e50d16af48c92d69d81733bd04fed01c
# Parent  1d76f329321de2af7afb59dc06c61bae87078481
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 04056409e50d
bdiff: use PYMODULEINIT

diff --git a/mercurial/bdiff_module.c b/mercurial/bdiff_module.c
--- a/mercurial/bdiff_module.c
+++ b/mercurial/bdiff_module.c
@@ -193,21 +193,3 @@ static PyMethodDef methods[] = {
 };
 
-#ifdef IS_PY3K
-static struct PyModuleDef bdiff_module = {
-	PyModuleDef_HEAD_INIT,
-	"bdiff",
-	mdiff_doc,
-	-1,
-	methods
-};
-
-PyMODINIT_FUNC PyInit_bdiff(void)
-{
-	return PyModule_Create(&bdiff_module);
-}
-#else
-PyMODINIT_FUNC initbdiff(void)
-{
-	Py_InitModule3("bdiff", methods, mdiff_doc);
-}
-#endif
+PYMODULEINIT(bdiff, methods, mdiff_doc, 1, NULL, NULL);


More information about the Mercurial-devel mailing list