mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user