Skip to content

Commit 214e5ce

Browse files
committed
Retrieve framework list in a safer way
Resolve #551
1 parent c44b39e commit 214e5ce

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

builder/main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
105105
# Target: Build executable and linkable firmware
106106
#
107107

108-
if "zephyr" in env.get("PIOFRAMEWORK", []):
108+
frameworks = env.get("PIOFRAMEWORK", [])
109+
if "zephyr" in frameworks:
109110
env.SConscript(
110111
join(platform.get_package_dir(
111112
"framework-zephyr"), "scripts", "platformio", "platformio-build-pre.py"),
@@ -219,7 +220,7 @@ def _jlink_cmd_script(env, source):
219220

220221
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]
221222

222-
if "arduino" in env.get("PIOFRAMEWORK"):
223+
if "arduino" in frameworks:
223224
if env.subst("$BOARD").startswith("portenta"):
224225
upload_actions.insert(
225226
0,

0 commit comments

Comments
 (0)