Skip to content

Commit 12a8e63

Browse files
committed
Handle case where uid is None.
1 parent 3a2fb31 commit 12a8e63

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

microscope/stages/linkam.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,9 @@ def init_usb(self, uid):
11691169
# suggest that an OpenComms message should open a connection to the
11701170
# device with that serial number; with only one stage attached, it
11711171
# appears that OpenComms ignores the value of serialNumber.
1172-
if not isinstance(uid, bytes):
1172+
if uid is None:
1173+
uid = b''
1174+
elif not isinstance(uid, bytes):
11731175
uid = uid.encode()
11741176
self._lib.linkamInitialiseUSBCommsInfo(byref(self._commsinfo), ctypes.c_char_p(uid))
11751177

0 commit comments

Comments
 (0)