From 3af1425be7a786f79fe02902ca2f6079bacde809 Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Sun, 23 Jun 2024 14:17:47 +0200 Subject: [PATCH] tools/mpremote: Fix mpremote mip install with multiple lib in sys.path. This is a fix for an algorithmic error in mpremote mip, that throws an error due to a '\n' used in the concatenation and split when there is more than one lib path in `sys.path`. Signed-off-by: Jos Verlinde --- tools/mpremote/mpremote/mip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/mpremote/mpremote/mip.py b/tools/mpremote/mpremote/mip.py index 46c9686ad..c86bf01f4 100644 --- a/tools/mpremote/mpremote/mip.py +++ b/tools/mpremote/mpremote/mip.py @@ -179,9 +179,9 @@ def do_mip(state, args): if args.target is None: state.transport.exec("import sys") lib_paths = ( - state.transport.eval("'\\n'.join(p for p in sys.path if p.endswith('/lib'))") + state.transport.eval("'|'.join(p for p in sys.path if p.endswith('/lib'))") .decode() - .split("\n") + .split("|") ) if lib_paths and lib_paths[0]: args.target = lib_paths[0]