From ca7a10039252f021ab6cd878987c8642c78bbafe Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 5 Nov 2022 12:03:06 +0200 Subject: [PATCH] Import the "zeroconf" module only when a user lists mDNS devices (issue with zeroconf's LGPL license) --- HISTORY.rst | 2 ++ platformio/device/list/util.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 3cc5f75f..099cf332 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,8 @@ PlatformIO Core 6 6.1.6 (2022-??-??) ~~~~~~~~~~~~~~~~~~ +* Import the "zeroconf" module only when a user lists mDNS devices (issue with zeroconf's LGPL license) + 6.1.5 (2022-11-01) ~~~~~~~~~~~~~~~~~~ diff --git a/platformio/device/list/util.py b/platformio/device/list/util.py index 2c1d0385..297f43fc 100644 --- a/platformio/device/list/util.py +++ b/platformio/device/list/util.py @@ -18,8 +18,6 @@ import re import time from glob import glob -import zeroconf - from platformio import __version__, exception, proc from platformio.compat import IS_MACOS, IS_WINDOWS @@ -84,6 +82,8 @@ def list_logical_devices(): def list_mdns_services(): + import zeroconf + class mDNSListener: def __init__(self): self._zc = zeroconf.Zeroconf(interfaces=zeroconf.InterfaceChoice.All)