diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2023-02-01 13:17:21 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-02-03 02:27:32 +0000 |
commit | 8f2f3b00c2fb3aade9f136d758e76d4ce9601ae2 (patch) | |
tree | faadba414f1b68f13be8717e26c5c899abc44f5d /lib/tevent | |
parent | c0ef6ca98bb9d494c5810313d8ab30b149e82953 (diff) | |
download | samba-8f2f3b00c2fb3aade9f136d758e76d4ce9601ae2.tar.gz |
tevent/pytevent: remove py2 ifdefs
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib/tevent')
-rw-r--r-- | lib/tevent/pytevent.c | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c index 6e8c8b72e1c..2d694b969e5 100644 --- a/lib/tevent/pytevent.c +++ b/lib/tevent/pytevent.c @@ -26,9 +26,7 @@ #include "replace.h" #include <tevent.h> -#if PY_MAJOR_VERSION >= 3 #define PyLong_FromLong PyLong_FromLong -#endif /* discard signature of 'func' in favour of 'target_sig' */ #define PY_DISCARD_FUNC_SIG(target_sig, func) (target_sig)(void(*)(void))func @@ -736,7 +734,6 @@ static PyMethodDef tevent_methods[] = { #define MODULE_DOC PyDoc_STR("Python wrapping of talloc-maintained objects.") -#if PY_MAJOR_VERSION >= 3 static struct PyModuleDef moduledef = { PyModuleDef_HEAD_INIT, .m_name = "_tevent", @@ -744,7 +741,6 @@ static struct PyModuleDef moduledef = { .m_size = -1, .m_methods = tevent_methods, }; -#endif PyObject * module_init(void); PyObject * module_init(void) @@ -769,11 +765,7 @@ PyObject * module_init(void) if (PyType_Ready(&TeventFd_Type) < 0) return NULL; -#if PY_MAJOR_VERSION >= 3 m = PyModule_Create(&moduledef); -#else - m = Py_InitModule3("_tevent", tevent_methods, MODULE_DOC); -#endif if (m == NULL) return NULL; @@ -800,16 +792,8 @@ PyObject * module_init(void) return m; } -#if PY_MAJOR_VERSION >= 3 PyMODINIT_FUNC PyInit__tevent(void); PyMODINIT_FUNC PyInit__tevent(void) { return module_init(); } -#else -void init_tevent(void); -void init_tevent(void) -{ - module_init(); -} -#endif |