From 5c4da6e82bfc6efc369b84c68176ea660866054e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Tue, 23 May 2023 12:12:42 +0200 Subject: [PATCH] [core] Fix ltchiptool installation in PlatformIO --- platform.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/platform.py b/platform.py index 8c7e7f3..2da5b4a 100644 --- a/platform.py +++ b/platform.py @@ -5,8 +5,8 @@ import json import os import platform import sys -from os import system from os.path import dirname +from subprocess import Popen from typing import Dict, List import click @@ -25,10 +25,18 @@ def check_ltchiptool(install: bool): if install: # update ltchiptool to a supported version print("Installing/updating ltchiptool") - system( - f'"{sys.executable}" -m pip install -U --force-reinstall ' - f'"ltchiptool >= {LTCHIPTOOL_VERSION[1:]}, < 5.0"' + p = Popen( + [ + sys.executable, + "-m", + "pip", + "install", + "-U", + "--force-reinstall", + f"ltchiptool >= {LTCHIPTOOL_VERSION[1:]}, < 5.0", + ], ) + p.wait() # unload all modules from the old version for name, module in list(sorted(sys.modules.items())):