diff --git a/pyfstat/tcw_fstat_map_funcs.py b/pyfstat/tcw_fstat_map_funcs.py index e3ef1f34c2e6e3a4149cc5a0a66c14403bfad2d3..10ee31f4cdaed84de2660134b978d3b8d7a0a76c 100644 --- a/pyfstat/tcw_fstat_map_funcs.py +++ b/pyfstat/tcw_fstat_map_funcs.py @@ -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)) - success = False - else: - raise + logging.debug("Failed to import module {:s}.".format(modulename)) + success = False return success