From e7b0752ecd9fa89a1171fcaa5fe415d04f38a17d Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Fri, 31 Mar 2017 18:45:52 +0530 Subject: [PATCH] Fix astrcmp for new Py3 C API --- picard/util/astrcmp.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/picard/util/astrcmp.c b/picard/util/astrcmp.c index 964108c48..1e682b598 100644 --- a/picard/util/astrcmp.c +++ b/picard/util/astrcmp.c @@ -170,8 +170,17 @@ static PyMethodDef AstrcmpMethods[] = { {NULL, NULL, 0, NULL} }; -PyMODINIT_FUNC -initastrcmp(void) +static struct PyModuleDef AstrcmpModule = { - (void)Py_InitModule("astrcmp", AstrcmpMethods); -} + PyModuleDef_HEAD_INIT, + "astrcmp", /* name of module */ + NULL, /* module documentation, may be NULL */ + -1, /* size of per-interpreter state of the module, or -1 if the module keeps state in global variables. */ + AstrcmpMethods +}; + +PyMODINIT_FUNC +PyInit_astrcmp(void) +{ + return PyModule_Create(&AstrcmpModule); +} \ No newline at end of file