Skip to content

Commit 2db0c02

Browse files
committed
tools/mpremote: Make mip install skip /rom*/lib directories.
If a ROMFS is mounted then "/rom/lib" is usually in `sys.path` before the writable filesystem's "lib" entry. The ROMFS directory cannot be installed to, so skip it if found. Signed-off-by: Damien George <[email protected]>
1 parent e4051a1 commit 2db0c02

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tools/mpremote/mpremote/mip.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,11 @@ def do_mip(state, args):
175175

176176
if args.target is None:
177177
state.transport.exec("import sys")
178-
lib_paths = [p for p in state.transport.eval("sys.path") if p.endswith("/lib")]
178+
lib_paths = [
179+
p
180+
for p in state.transport.eval("sys.path")
181+
if not p.startswith("/rom") and p.endswith("/lib")
182+
]
179183
if lib_paths and lib_paths[0]:
180184
args.target = lib_paths[0]
181185
else:

0 commit comments

Comments
 (0)