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

login
register
mail settings
Submitter Gregory Szorc
Date Oct. 8, 2016, 5:09 p.m.
Message ID <66c3f600e684f2323ac5.1475946557@gps-mbp.local>
Download mbox | patch
Permalink /patch/16955/
State Accepted
Headers show

Comments

Gregory Szorc - Oct. 8, 2016, 5:09 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.
Yuya Nishihara - Oct. 9, 2016, 6:22 a.m.
On Sat, 08 Oct 2016 19:09:17 +0200, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@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

Queued, thanks.

Patch

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;
 }