diff options
| author | Simon McVittie <smcv@collabora.com> | 2021-09-14 16:48:18 +0100 |
|---|---|---|
| committer | Simon McVittie <smcv@collabora.com> | 2021-09-15 18:49:14 +0100 |
| commit | 98cbe2b3ace53ef70738345548402cb4e74a4db7 (patch) | |
| tree | 8214142a629fc4d45b0fc647860b7ae4bd6b9776 /include/dbus | |
| parent | abd5b946bb2ca9b6c4d2f5e455aaaae5f38946c6 (diff) | |
| download | dbus-python-98cbe2b3ace53ef70738345548402cb4e74a4db7.tar.gz | |
Remove support for Python 2
Python 2 reached EOL on 2020-01-01, and the latest version of
AX_PYTHON_DEVEL breaks the build with Python 2. This seems as good a
time as any to drop compatibility.
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'include/dbus')
| -rw-r--r-- | include/dbus/dbus-python.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/include/dbus/dbus-python.h b/include/dbus/dbus-python.h index b67e7c4..72a9bf1 100644 --- a/include/dbus/dbus-python.h +++ b/include/dbus/dbus-python.h @@ -34,10 +34,7 @@ #include <Python.h> #include <dbus/dbus.h> -#if PY_MAJOR_VERSION >= 3 -#define PY3 #define PYDBUS_CAPSULE_NAME "_dbus_bindings._C_API" -#endif DBUS_BEGIN_DECLS @@ -80,7 +77,6 @@ import_dbus_bindings(const char *this_module_name) } c_api = PyObject_GetAttrString(_dbus_bindings_module, "_C_API"); if (c_api == NULL) return -1; -#ifdef PY3 dbus_bindings_API = NULL; if (PyCapsule_IsValid(c_api, PYDBUS_CAPSULE_NAME)) { dbus_bindings_API = (_dbus_py_func_ptr *)PyCapsule_GetPointer( @@ -91,17 +87,6 @@ import_dbus_bindings(const char *this_module_name) PyErr_SetString(PyExc_RuntimeError, "C API is not a PyCapsule"); return -1; } -#else - if (PyCObject_Check(c_api)) { - dbus_bindings_API = (_dbus_py_func_ptr *)PyCObject_AsVoidPtr(c_api); - } - else { - Py_DECREF(c_api); - PyErr_SetString(PyExc_RuntimeError, "C API is not a PyCObject"); - return -1; - } - Py_DECREF (c_api); -#endif count = *(int *)dbus_bindings_API[0]; if (count < DBUS_BINDINGS_API_COUNT) { PyErr_Format(PyExc_RuntimeError, |
