Skip to content

Commit 28f7990

Browse files
committed
mtree: return early from walk() if the path does not exist
1 parent 5647dec commit 28f7990

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pycheribuild/mtree.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ def _walk(self, top, prefix) -> "Iterator[tuple[MtreePath, list[str], list[str]]
216216
yield from v._walk(MtreePath(), prefix)
217217

218218
def walk(self, top) -> "Iterator[tuple[MtreePath, list[str], list[str]]]":
219+
if top not in self.children:
220+
return iter([])
219221
return self._walk(top, MtreePath())
220222

221223

0 commit comments

Comments
 (0)