]> arthur.barton.de Git - bup.git/commitdiff
bup.c: drop python 2
authorRob Browning <rlb@defaultvalue.org>
Tue, 3 May 2022 00:54:04 +0000 (19:54 -0500)
committerRob Browning <rlb@defaultvalue.org>
Tue, 3 May 2022 01:13:08 +0000 (20:13 -0500)
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/cmd/bup.c

index 228276a6011b9f3b438677bdddaf4edc30474948..66faef1e7bb185dde815fa74f2332bb77870008b 100644 (file)
@@ -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)