summaryrefslogtreecommitdiffstats
path: root/src/python/pysss_murmur.c
diff options
context:
space:
mode:
authorBohuslav Kabrda <bkabrda@redhat.com>2014-12-12 11:04:40 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-01-13 10:25:37 +0100
commit341a00311680a440d7f979f06c34c70d86c9367a (patch)
tree95fdcbed6ddffb50958174c42157ceecaa06ac66 /src/python/pysss_murmur.c
parentfaae3d55e5cf416f16158d3b9f8c8fd475ac6acf (diff)
downloadsssd-341a00311680a440d7f979f06c34c70d86c9367a.tar.gz
sssd-341a00311680a440d7f979f06c34c70d86c9367a.tar.xz
sssd-341a00311680a440d7f979f06c34c70d86c9367a.zip
Python3 support in SSSD
https://fedorahosted.org/sssd/ticket/2017
Diffstat (limited to 'src/python/pysss_murmur.c')
-rw-r--r--src/python/pysss_murmur.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/python/pysss_murmur.c b/src/python/pysss_murmur.c
index a193c56da..97d752b2a 100644
--- a/src/python/pysss_murmur.c
+++ b/src/python/pysss_murmur.c
@@ -60,10 +60,36 @@ static PyMethodDef methods[] = {
{ NULL,NULL, 0, NULL }
};
+#ifdef IS_PY3K
+static struct PyModuleDef pysss_murmurdef = {
+ PyModuleDef_HEAD_INIT,
+ "pysss_murmur",
+ NULL,
+ -1,
+ methods,
+ NULL,
+ NULL,
+ NULL,
+ NULL
+};
PyMODINIT_FUNC
+PyInit_pysss_murmur(void)
+#else
+PyMODINIT_FUNC
initpysss_murmur(void)
+#endif
{
- Py_InitModule3(sss_py_const_p(char, "pysss_murmur"),
+ PyObject *m;
+#ifdef IS_PY3K
+ m = PyModule_Create(&pysss_murmurdef);
+#else
+ m = Py_InitModule3(sss_py_const_p(char, "pysss_murmur"),
methods, sss_py_const_p(char, "murmur hash functions"));
+#endif
+ if (m == NULL)
+ MODINITERROR;
+#ifdef IS_PY3K
+ return m;
+#endif
}