From d4532555c8c04d0813be51cfa5d3253bd19f31bf Mon Sep 17 00:00:00 2001 From: Ross Brattain Date: Thu, 24 Aug 2017 21:52:41 -0700 Subject: utils: catch SyntaxError during import bad modules can also throw SyntaxError besides ImportError Change-Id: I4fa912505753cba3c06f127105354572b7f5ddd8 Signed-off-by: Ross Brattain --- yardstick/common/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yardstick/common/utils.py b/yardstick/common/utils.py index 1d7ea071c..68c9ed63f 100644 --- a/yardstick/common/utils.py +++ b/yardstick/common/utils.py @@ -90,7 +90,7 @@ def import_modules_from_package(package): for module_name in missing_modules: try: sys.modules[module_name] = importutils.import_module(module_name) - except ImportError: + except (ImportError, SyntaxError): logger.exception("unable to import %s", module_name) -- cgit 1.2.3-korg