Skip to content

Commit

Permalink
accuraterip-checksum.c: Port to Python 3
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Oberritter <[email protected]>
  • Loading branch information
mtdcr authored and JoeLametta committed Nov 4, 2019
1 parent e93a1c2 commit 9edc98d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/accuraterip-checksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,24 @@ static PyMethodDef accuraterip_methods[] = {
{ NULL, NULL, 0, NULL },
};

#if PY_MAJOR_VERSION < 3

PyMODINIT_FUNC initaccuraterip(void)
{
Py_InitModule("accuraterip", accuraterip_methods);
}

#else /* PY_MAJOR_VERSION >= 3 below */

static struct PyModuleDef accuraterip_module = {
.m_base = PyModuleDef_HEAD_INIT,
.m_name = "accuraterip",
.m_methods = accuraterip_methods,
};

PyMODINIT_FUNC PyInit_accuraterip(void)
{
return PyModule_Create(&accuraterip_module);
}

#endif

0 comments on commit 9edc98d

Please sign in to comment.