Skip to content

Commit 4a50444

Browse files
carlescufinashif
authored andcommitted
west: flash: Fix exception on build folder guessing
When guessing the build folder, the current path might not exist at all, leading to an uncaught exception when trying to list its folders. Fix this by making sure the path exists at all first. Signed-off-by: Carles Cufi <[email protected]>
1 parent ea438d0 commit 4a50444

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/west_commands/build_helpers.py

+2
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ def _resolve_build_dir(fmt, guess, cwd, **kwargs):
6464
except KeyError:
6565
# Missing key, check sub-folders and match if a single one exists
6666
while True:
67+
if not curr.exists():
68+
return None
6769
dirs = [f for f in curr.iterdir() if f.is_dir()]
6870
if len(dirs) != 1:
6971
return None

0 commit comments

Comments
 (0)