Skip to content
Snippets Groups Projects
Commit fa204efb authored by Reinhard Prix's avatar Reinhard Prix
Browse files

_optional_import: don't re-raise ImportError exception ever

- any import failure should just be treated as such: we can't import
  that module for whatever reason
parent 7e146315
No related branches found
No related tags found
No related merge requests found
...@@ -31,11 +31,8 @@ def _optional_import(modulename, shorthand=None): ...@@ -31,11 +31,8 @@ def _optional_import(modulename, shorthand=None):
logging.debug("Successfully imported module %s%s." % (modulename, shorthandbit)) logging.debug("Successfully imported module %s%s." % (modulename, shorthandbit))
success = True success = True
except ImportError as e: except ImportError as e:
if e.message == "No module named " + modulename: logging.debug("Failed to import module {:s}.".format(modulename))
logging.debug("No module {:s} found.".format(modulename))
success = False success = False
else:
raise
return success return success
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment