Skip to content

Commit 1f48934

Browse files
committed
tools/mpremote: Fix connect-list in case VID/PID are None.
Which can be the case on Windows and macOS for certain serial devices. Fixes issue micropython#7636. Signed-off-by: Damien George <[email protected]>
1 parent 8fcdb54 commit 1f48934

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tools/mpremote/mpremote/main.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ def do_connect(args):
166166
for p in sorted(serial.tools.list_ports.comports()):
167167
print(
168168
"{} {} {:04x}:{:04x} {} {}".format(
169-
p.device, p.serial_number, p.vid, p.pid, p.manufacturer, p.product
169+
p.device,
170+
p.serial_number,
171+
p.vid if isinstance(p.vid, int) else 0,
172+
p.pid if isinstance(p.pid, int) else 0,
173+
p.manufacturer,
174+
p.product,
170175
)
171176
)
172177
return None

0 commit comments

Comments
 (0)