mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2025-08-03 08:21:58 +03:00
sanitytest: Fix libvirtError class handling for Python 2.4
The Exception class hiearchy in Python 2.4 reports different data types than in later Python versions. As a result the type(libvirt.libvirtError) does not return 'type'. We just special case handling of this class. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
@ -39,9 +39,11 @@ for name in dir(libvirt):
|
|||||||
if name[0] == '_':
|
if name[0] == '_':
|
||||||
continue
|
continue
|
||||||
thing = getattr(libvirt, name)
|
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) == int:
|
||||||
gotenums.append(name)
|
gotenums.append(name)
|
||||||
elif type(thing) == type:
|
elif type(thing) == type or name == "libvirtError":
|
||||||
gottypes.append(name)
|
gottypes.append(name)
|
||||||
gotfunctions[name] = []
|
gotfunctions[name] = []
|
||||||
elif callable(thing):
|
elif callable(thing):
|
||||||
|
Reference in New Issue
Block a user