diff options
| author | Damien George <damien@micropython.org> | 2021-08-12 17:25:10 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-08-14 00:13:35 +1000 |
| commit | 1f48934312888a104a486d3655e0352657f35952 (patch) | |
| tree | 83f78e4dfc4f7bf4c13daaae0bdae3a76d324365 | |
| parent | 8fcdb5490c482dc11f3be70f8ab0cf844b600fb9 (diff) | |
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 #7636.
Signed-off-by: Damien George <damien@micropython.org>
| -rw-r--r-- | tools/mpremote/mpremote/main.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/mpremote/mpremote/main.py b/tools/mpremote/mpremote/main.py index d225bf2e4..6a6cbea57 100644 --- a/tools/mpremote/mpremote/main.py +++ b/tools/mpremote/mpremote/main.py @@ -166,7 +166,12 @@ def do_connect(args): for p in sorted(serial.tools.list_ports.comports()): print( "{} {} {:04x}:{:04x} {} {}".format( - p.device, p.serial_number, p.vid, p.pid, p.manufacturer, p.product + p.device, + p.serial_number, + p.vid if isinstance(p.vid, int) else 0, + p.pid if isinstance(p.pid, int) else 0, + p.manufacturer, + p.product, ) ) return None |
