From 4e835736d28e97724c90350f11a813872cbdb8a6 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Mon, 2 May 2022 19:54:04 -0500 Subject: [PATCH] bup.c: drop python 2 Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/cmd/bup.c | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/lib/cmd/bup.c b/lib/cmd/bup.c index 228276a..66faef1 100644 --- a/lib/cmd/bup.c +++ b/lib/cmd/bup.c @@ -66,8 +66,6 @@ static int setup_module(PyObject *mod) return 1; } -#if PY_MAJOR_VERSION >= 3 - static struct PyModuleDef bup_main_module_def = { .m_base = PyModuleDef_HEAD_INIT, .m_name = "bup_main", @@ -87,25 +85,6 @@ PyInit_bup_main(void) { return mod; } -#else // PY_MAJOR_VERSION < 3 - -void PyInit_bup_main(void) -{ - PyObject *mod = Py_InitModule("bup_main", bup_main_methods); - if (mod == NULL) { - PyErr_SetString(PyExc_RuntimeError, "bup._helpers init failed"); - return; - } - if (!setup_module(mod)) - { - PyErr_SetString(PyExc_RuntimeError, "bup._helpers set up failed"); - Py_DECREF(mod); - return; - } -} - -#endif // PY_MAJOR_VERSION < 3 - static void setup_bup_main_module(void) { @@ -338,10 +317,8 @@ prepend_lib_to_pythonpath(const char * const exec_path, #if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 8 # define bup_py_main bup_py_bytes_main -#elif PY_MAJOR_VERSION > 2 -# define bup_py_main Py_BytesMain #else -# define bup_py_main Py_Main +# define bup_py_main Py_BytesMain #endif #if defined(BUP_DEV_BUP_PYTHON) && defined(BUP_DEV_BUP_EXEC) -- 2.39.2