Skip to content

Commit be3388b

Browse files
authored
avoid possible issues with Windows
1 parent d4c8d2a commit be3388b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

builder/penv_setup.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,17 @@ def install_esptool(env, platform, python_exe, uv_executable):
263263
# Check if esptool is already installed from the correct path
264264
try:
265265
result = subprocess.run(
266-
[python_exe, "-c",
267-
"import esptool; "
268-
"import os; "
269-
f"expected_path = os.path.normpath(r'{esptool_repo_path}'); "
270-
"actual_path = os.path.normpath(os.path.dirname(esptool.__file__)); "
271-
"print('MATCH' if expected_path in actual_path else 'MISMATCH')"],
266+
[
267+
python_exe,
268+
"-c",
269+
(
270+
"import esptool, os, sys; "
271+
"expected_path = os.path.normcase(os.path.realpath(sys.argv[1])); "
272+
"actual_path = os.path.normcase(os.path.realpath(os.path.dirname(esptool.__file__))); "
273+
"print('MATCH' if actual_path.startswith(expected_path) else 'MISMATCH')"
274+
),
275+
esptool_repo_path,
276+
],
272277
capture_output=True,
273278
check=True,
274279
text=True,

0 commit comments

Comments
 (0)