Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def open(self):
"""
Open device.
Returns an USBDeviceHandle instance.
"""
handle = libusb1.libusb_device_handle_p()
result = libusb1.libusb_open(self.device_p, byref(handle))
if result:
raise libusb1.USBError(result)
return USBDeviceHandle(self.__context, handle, self)
def open(self):
"""
Open device.
Returns an USBDeviceHandle instance.
"""
handle = libusb1.libusb_device_handle_p()
mayRaiseUSBError(libusb1.libusb_open(self.device_p, byref(handle)))
result = USBDeviceHandle(self.__context, handle, self)
self.__close_set.add(result)
return result
def open(self):
"""
Open device.
Returns an USBDeviceHandle instance.
"""
handle = libusb1.libusb_device_handle_p()
result = libusb1.libusb_open(self.device_p, byref(handle))
if result:
raise libusb1.USBError(result)
return USBDeviceHandle(self.__context, handle)