diff --git a/homeassistant/components/dhcp/__init__.py b/homeassistant/components/dhcp/__init__.py index cc89c9b785d..e6debfea2eb 100644 --- a/homeassistant/components/dhcp/__init__.py +++ b/homeassistant/components/dhcp/__init__.py @@ -279,6 +279,17 @@ class DHCPWatcher(WatcherBase): """Start watching for dhcp packets.""" # Local import because importing from scapy has side effects such as opening # sockets + from scapy import ( # pylint: disable=import-outside-toplevel,unused-import # noqa: F401 + arch, + ) + + # + # Importing scapy.sendrecv will cause a scapy resync which will + # import scapy.arch.read_routes which will import scapy.sendrecv + # + # We avoid this circular import by importing arch above to ensure + # the module is loaded and avoid the problem + # from scapy.sendrecv import ( # pylint: disable=import-outside-toplevel AsyncSniffer, )