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

login
register
mail settings
Submitter Jun Wu
Date May 9, 2017, 1:07 a.m.
Message ID <04056409e50d16af48c9.1494292044@x1c>
Download mbox | patch
Permalink /patch/20532/
State Superseded
Headers show

Comments

Jun Wu - May 9, 2017, 1:07 a.m.
# HG changeset patch
# User Jun Wu <quark@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

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