[libvirt-python PATCH] sanitytest: count with the fact that large enums can be long

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

 



On 32-bit systems, one new flag that has the value of 1 << 31, namely
VIR_CONNECT_GET_ALL_DOMAINS_STATS_ENFORCE_STATS, fails to fit into an
'int' on python and is therefore of type 'long'.  Fix sanitytest to
count with such fact in order to avoid build failures on 32-bit systems.

Signed-off-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
---

Notes:
    Pushed as a build-breaker.

 sanitytest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sanitytest.py b/sanitytest.py
index 8cb0154..5bd85a5 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -84,7 +84,7 @@ for name in dir(libvirt):
     thing = getattr(libvirt, name)
     # Special-case libvirtError to deal with python 2.4 difference
     # in Exception class type reporting.
-    if type(thing) == int:
+    if type(thing) in (int, long):
         gotenums.append(name)
     elif type(thing) == type or name == "libvirtError":
         gottypes.append(name)
-- 
2.1.2

--
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]