diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2019-12-04 10:27:36 +0000 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2019-12-04 12:14:51 +0000 |
commit | b22e4f2441078aec048b9503fde2b45e78710ce1 (patch) | |
tree | 9c06bcc560e4002401e3733aa22f79354d364300 /libvirt-utils.c | |
parent | e3fa4f22d5e9301e98a4d5bd420dee7d64150d64 (diff) | |
download | libvirt-python-b22e4f2441078aec048b9503fde2b45e78710ce1.tar.gz |
Drop support for python 2
python2 will be end of life by the time of the next
libvirt release. All our supported build targets, including
CentOS7, have a python3 build available.
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'libvirt-utils.c')
-rw-r--r-- | libvirt-utils.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/libvirt-utils.c b/libvirt-utils.c index 78b94ca..d8ff11d 100644 --- a/libvirt-utils.c +++ b/libvirt-utils.c @@ -1,7 +1,7 @@ /* * libvirt-utils.c: misc helper APIs for python binding * - * Copyright (C) 2013 Red Hat, Inc. + * Copyright (C) 2013-2019 Red Hat, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -274,11 +274,7 @@ setPyVirTypedParameter(PyObject *info, int nparams) { PyObject *key, *value; -#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 4 - int pos = 0; -#else Py_ssize_t pos = 0; -#endif virTypedParameterPtr temp = NULL, ret = NULL; Py_ssize_t size; ssize_t i; @@ -416,13 +412,6 @@ virPyDictToTypedParamOne(virTypedParameterPtr *params, type = VIR_TYPED_PARAM_LLONG; else type = VIR_TYPED_PARAM_ULLONG; -#if PY_MAJOR_VERSION < 3 - } else if (PyInt_Check(value)) { - if (PyInt_AS_LONG(value) < 0) - type = VIR_TYPED_PARAM_LLONG; - else - type = VIR_TYPED_PARAM_ULLONG; -#endif } else if (PyFloat_Check(value)) { type = VIR_TYPED_PARAM_DOUBLE; } @@ -520,11 +509,7 @@ virPyDictToTypedParams(PyObject *dict, { PyObject *key; PyObject *value; -#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 4 - int pos = 0; -#else Py_ssize_t pos = 0; -#endif virTypedParameterPtr params = NULL; int n = 0; int max = 0; |