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

Martin Kletzander mkletzan at redhat.com
Tue Oct 7 08:18:13 UTC 2014


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 at redhat.com>
---

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




More information about the libvir-list mailing list