Patchwork [3,of,7,V2] bdiff: use PYMODULEINIT

login
register
mail settings
Submitter Jun Wu
Date May 13, 2017, 6:55 p.m.
Message ID <2387f3cfbf1ef2b8cfec.1494701725@x1c>
Download mbox | patch
Permalink /patch/20599/
State Superseded
Headers show

Comments

Jun Wu - May 13, 2017, 6:55 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1494290228 25200
#      Mon May 08 17:37:08 2017 -0700
# Node ID 2387f3cfbf1ef2b8cfec514cc558d94dc257a219
# Parent  407cb540b3a59ec291f2166d1592af78d992fbfb
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 2387f3cfbf1e
bdiff: use PYMODULEINIT

Patch

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, SKIP, SKIP);