[PATCH] Fix build of python bindings on Python 2.4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The PyDict_Next method on Python <= 2.4 used 'int' instead
of "Py_ssize_t" for the 'pos' parameter

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 python/libvirt-override.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 856789a..fd9ebb8 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -152,7 +152,11 @@ setPyVirTypedParameter(PyObject *info,
                        const virTypedParameterPtr params, 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;
     int i;
-- 
1.8.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]