Skip to content

Commit 47fb2dd

Browse files
committed
fix windows path selection
1 parent ef1c223 commit 47fb2dd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/nrfcredstore/comms.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,13 @@ def select_device(rtt : bool, serial_number : Optional[Union[str, int]], port :
211211
return (None, select_jlink(jlinks, list_all))
212212

213213
if port:
214-
real_path = os.path.realpath(port)
214+
if port.startswith("COM"):
215+
# workaround for Windows
216+
real_path = port
217+
else:
218+
# for Linux users that make use of the /dev/serial/by-id/ symlink
219+
real_path = os.path.realpath(port)
220+
215221
# Serial ports are unique, so we just check if it exists and try to get a serial number
216222
serial_devices = [x for x in get_comports_fixed_ordering() if x.device == real_path]
217223
if len(serial_devices) == 0:

0 commit comments

Comments
 (0)