Avoid keeping config dir in path (#107760)
This commit is contained in:
parent
7fe6fc987b
commit
523352c97e
3 changed files with 18 additions and 2 deletions
|
@ -1177,8 +1177,12 @@ def _async_mount_config_dir(hass: HomeAssistant) -> None:
|
|||
|
||||
Async friendly but not a coroutine.
|
||||
"""
|
||||
if hass.config.config_dir not in sys.path:
|
||||
sys.path.insert(0, hass.config.config_dir)
|
||||
|
||||
sys.path.insert(0, hass.config.config_dir)
|
||||
with suppress(ImportError):
|
||||
import custom_components # pylint: disable=import-outside-toplevel # noqa: F401
|
||||
sys.path.remove(hass.config.config_dir)
|
||||
sys.path_importer_cache.pop(hass.config.config_dir, None)
|
||||
|
||||
|
||||
def _lookup_path(hass: HomeAssistant) -> list[str]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue