Skip to content

Commit fc53612

Browse files
committed
Encode device parameter before channel retrieval
Fixed an issue in the `get_channels_for_device` function where the input device name wasn't being encoded before passing it to the underlying C function `getChannelsFromInfo`. This change ensures compatibility with the expected string encoding, preventing potential runtime errors related to string handling across the Python-C boundary.
1 parent 8874795 commit fc53612

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/limedriver/limedriver.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,5 +724,5 @@ def get_device_list():
724724
return [device.decode('utf-8') for device in devices]
725725

726726
def get_channels_for_device(device = ""):
727-
cdef pair[int, int] channels = getChannelsFromInfo(device)
727+
cdef pair[int, int] channels = getChannelsFromInfo(device.encode())
728728
return channels.first, channels.second

0 commit comments

Comments
 (0)