From 6d0e9531c867d98eda4da742f85573a600ba5e5c Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Fri, 10 Jan 2020 13:23:45 +0100 Subject: [PATCH] python: tests: catch specific exception 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.