diff options
Diffstat (limited to 'silx/utils/launcher.py')
-rw-r--r-- | silx/utils/launcher.py | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/silx/utils/launcher.py b/silx/utils/launcher.py index 8d2c81c..059e990 100644 --- a/silx/utils/launcher.py +++ b/silx/utils/launcher.py @@ -2,7 +2,7 @@ # coding: utf-8 # /*########################################################################## # -# Copyright (c) 2004-2016 European Synchrotron Radiation Facility +# Copyright (c) 2004-2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -41,7 +41,7 @@ import logging _logger = logging.getLogger(__name__) -class LauncherCommand(): +class LauncherCommand(object): """Description of a command""" def __init__(self, name, description=None, module_name=None, function=None): @@ -68,17 +68,9 @@ class LauncherCommand(): try: module = importlib.import_module(self.module_name) return module - except ImportError as e: - if "No module name" in e.args[0]: - msg = "Error while reaching module '%s'" - _logger.debug(msg, self.module_name, exc_info=True) - missing_module = e.args[0].split("'")[1] - msg = "Module '%s' is not installed but is mandatory."\ - + " You can install it using \"pip install %s\"." - _logger.error(msg, missing_module, missing_module) - else: - msg = "Error while reaching module '%s'" - _logger.error(msg, self.module_name, exc_info=True) + except ImportError: + msg = "Error while reaching module '%s'" + _logger.error(msg, self.module_name, exc_info=True) return None def get_function(self): |