From 0d647e164b1e0ecc467a64fdde7a0a563344ac39 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 18 Mar 2024 17:45:54 +0200 Subject: [PATCH] Skip unnecessary import --- platformio/compat.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/platformio/compat.py b/platformio/compat.py index 6bd8029c..d5455099 100644 --- a/platformio/compat.py +++ b/platformio/compat.py @@ -42,7 +42,10 @@ else: if sys.version_info >= (3, 9): from asyncio import to_thread as aio_to_thread else: - from starlette.concurrency import run_in_threadpool as aio_to_thread + try: + from starlette.concurrency import run_in_threadpool as aio_to_thread + except ImportError: + pass PY2 = sys.version_info[0] == 2 # DO NOT REMOVE IT. ESP8266/ESP32 depend on it