python: tests: catch specific exception

When trying to import libvirt, catch the specific exception that is
raised when an importing fails.
This commit is contained in:
Pino Toscano
2020-01-10 13:23:45 +01:00
parent 0703ec9c8c
commit 6d0e9531c8

View File

@@ -56,7 +56,7 @@ def skipUnlessLibvirtHasCPointer():
"""
try:
import libvirt
except:
except ImportError:
return unittest.skip("could not import libvirt")
# Check we're using the version of libvirt-python that has
# c_pointer() methods.