mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Suppress specific import errors in the loader
This commit is contained in:
parent
5fe50066a6
commit
7938cbffd4
@ -132,10 +132,13 @@ def get_component(comp_name):
|
||||
|
||||
return module
|
||||
|
||||
except ImportError:
|
||||
_LOGGER.exception(
|
||||
("Error loading %s. Make sure all "
|
||||
"dependencies are installed"), path)
|
||||
except ImportError as err:
|
||||
# This error happens if for example custom_components/switch
|
||||
# exists and we try to load switch.demo.
|
||||
if str(err) != "No module named '{}'".format(path):
|
||||
_LOGGER.exception(
|
||||
("Error loading %s. Make sure all "
|
||||
"dependencies are installed"), path)
|
||||
|
||||
_LOGGER.error("Unable to find component %s", comp_name)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user