From dd3fe909a1e4c020e5657f78cda0b4a7ebb42aed Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 12 Dec 2024 16:32:43 +0200 Subject: [PATCH] Better handling of the missed args for exec command // Resolve #5047 --- platformio/package/commands/exec.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/package/commands/exec.py b/platformio/package/commands/exec.py index 41386d5e..849a9320 100644 --- a/platformio/package/commands/exec.py +++ b/platformio/package/commands/exec.py @@ -54,7 +54,7 @@ def package_exec_cmd(obj, package, call, args): os.environ["PIO_PYTHON_EXE"] = get_pythonexe_path() # inject current python interpreter on Windows - if args[0].endswith(".py"): + if args and args[0].endswith(".py"): args = [os.environ["PIO_PYTHON_EXE"]] + list(args) if not os.path.exists(args[1]): args[1] = where_is_program(args[1])