Skip to content

usb.busses returns generator - needs to be a list #2

Closed
@kda

Description

@kda

I'm using a newer version of PyUSB (http://walac.github.io/pyusb/) and it seems that 'usb.busses' returns a generator rather than a list. This simple patch seems to fix it for me.

diff --git a/powerusb/hidapi.py b/powerusb/hidapi.py
index e8e47322559c..a0d49c2a1c03 100644
--- a/powerusb/hidapi.py
+++ b/powerusb/hidapi.py
@@ -68,7 +68,7 @@ def hid_enumerate(vendor_id, product_id):
     hid_devices = []

-    busses = usb.busses()
+    busses = list(usb.busses())

     # check each bus
     for b_index in range(0, len(busses)):

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions