summaryrefslogtreecommitdiff
path: root/devel/py-libusb1/files/patch-usb1_____init____.py
diff options
context:
space:
mode:
authorJan Beich <jbeich@FreeBSD.org>2017-02-04 07:41:56 +0000
committerJan Beich <jbeich@FreeBSD.org>2017-02-04 07:41:56 +0000
commitd3020eab78c95b9e02feb373ebfd772e9c44df2f (patch)
tree60bb2a3517ea190e18a5ec9193cba2d59a526fe0 /devel/py-libusb1/files/patch-usb1_____init____.py
parentdevel/py-adb: update to 1.1.1.37 (snapshot) (diff)
devel/py-libusb1: update to 1.6.4
devel/py-adb stays on the old version due to google/python-adb#36 Changes: https://pypi.python.org/pypi/libusb1#id60
Diffstat (limited to 'devel/py-libusb1/files/patch-usb1_____init____.py')
-rw-r--r--devel/py-libusb1/files/patch-usb1_____init____.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/devel/py-libusb1/files/patch-usb1_____init____.py b/devel/py-libusb1/files/patch-usb1_____init____.py
new file mode 100644
index 000000000000..e42cf7f83290
--- /dev/null
+++ b/devel/py-libusb1/files/patch-usb1_____init____.py
@@ -0,0 +1,26 @@
+https://lists.freebsd.org/pipermail/freebsd-usb/2015-January/013586.html
+
+--- usb1/__init__.py.orig 2016-11-23 13:07:52 UTC
++++ usb1/__init__.py
+@@ -1830,15 +1830,20 @@ class USBDevice(object):
+ """
+ Get device's port number.
+ """
+- return libusb1.libusb_get_port_number(self.device_p)
++ try:
++ return libusb1.libusb_get_port_number(self.device_p)
++ except AttributeError:
++ return 0
+
+ def getPortNumberList(self):
+ """
+ Get the port number of each hub toward device.
+ """
+ port_list = (c_uint8 * PATH_MAX_DEPTH)()
++ temp_handle = self.open()
+ result = libusb1.libusb_get_port_numbers(
+ self.device_p, port_list, len(port_list))
++ temp_handle.close()
+ mayRaiseUSBError(result)
+ return list(port_list[:result])
+