Skip to content

Commit

Permalink
Merge pull request #104 from google/gbg/fix-windll-load
Browse files Browse the repository at this point in the history
fix libusb loading on Windows
  • Loading branch information
barbibulle authored Dec 20, 2022
2 parents 7ae3a1d + 6e0129b commit ea6a8d4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bumble/transport/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ def load_libusb():
when usb1.USBContext is created.
'''
if libusb_path := libusb_package.get_library_path():
logger.debug(f'loading libusb library at {libusb_path}')
dll_loader = ctypes.WinDLL if platform.system() == 'Windows' else ctypes.CDLL
libusb_dll = dll_loader(libusb_path, use_errno=True, use_last_error=True)
libusb_dll = dll_loader(str(libusb_path), use_errno=True, use_last_error=True)
usb1.loadLibrary(libusb_dll)


Expand Down

0 comments on commit ea6a8d4

Please sign in to comment.