[PATCH 1 of 2] parsers: return NULL from PyInit_parsers on Python 3

Gregory Szorc gregory.szorc at gmail.com
Sat Oct 8 17:09:17 UTC 2016


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1475941889 -7200
#      Sat Oct 08 17:51:29 2016 +0200
# Node ID 66c3f600e684f2323ac56c16eba6a57930f8919e
# Parent  f98e32b5c44fafb85bee108abe2a24595e59ddbc
parsers: return NULL from PyInit_parsers on Python 3

This function must return a PyObject* or the compiler complains.

diff --git a/mercurial/parsers.c b/mercurial/parsers.c
--- a/mercurial/parsers.c
+++ b/mercurial/parsers.c
@@ -2879,9 +2879,9 @@ PyMODINIT_FUNC PyInit_parsers(void)
 {
 	PyObject *mod;
 
 	if (check_python_version() == -1)
-		return;
+		return NULL;
 	mod = PyModule_Create(&parsers_module);
 	module_init(mod);
 	return mod;
 }


More information about the Mercurial-devel mailing list