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
1 merge request!21Make tests more robust
......@@ -31,11 +31,8 @@ def _optional_import(modulename, shorthand=None):
logging.debug("Successfully imported module %s%s." % (modulename, shorthandbit))
success = True
except ImportError as e:
if e.message == "No module named " + modulename:
logging.debug("No module {:s} found.".format(modulename))
logging.debug("Failed to import module {:s}.".format(modulename))
success = False
else:
raise
return success
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment