Skip to content

Commit 17bd151

Browse files
committed
Check if cmd is list before accessing elements
1 parent ad88833 commit 17bd151

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

platformio/package/manager/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def call_pkg_script(self, pkg, event):
334334
cmd = [cmd]
335335
os.environ["PIO_PYTHON_EXE"] = get_pythonexe_path()
336336
with fs.cd(pkg.path):
337-
if os.path.isfile(cmd[0]) and cmd[0].endswith(".py"):
337+
if isinstance(cmd, list) and os.path.isfile(cmd[0]) and cmd[0].endswith(".py"):
338338
python_exe = os.environ["PIO_PYTHON_EXE"]
339339
# Quote the path if it contains spaces (Windows compatibility)
340340
if " " in python_exe:

0 commit comments

Comments
 (0)