10 Jan
2020
10 Jan
'20
4:26 p.m.
When trying to import libvirt, catch the specific exception that is raised when an importing fails. --- python/t/tests_helper.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/t/tests_helper.py.in b/python/t/tests_helper.py.in index 93783430e..38f0dc521 100644 --- a/python/t/tests_helper.py.in +++ b/python/t/tests_helper.py.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. -- 2.24.1