hidapi: fix bug in processing of serial numbers

This commit is contained in:
Peter F. Patel-Schneider 2020-10-06 18:09:25 -04:00
parent 7a7aad8977
commit dba9d472a8
1 changed files with 1 additions and 2 deletions

View File

@ -404,8 +404,7 @@ def get_serial(device_handle):
:param device_handle: a device handle returned by open() or open_path(). :param device_handle: a device handle returned by open() or open_path().
""" """
serial = get_indexed_string(device_handle, 2) serial = get_indexed_string(device_handle, 2)
if serial is not None: return serial
return ''.join(hex(ord(c)) for c in serial)
def get_indexed_string(device_handle, index): def get_indexed_string(device_handle, index):