blinkstick-python icon indicating copy to clipboard operation
blinkstick-python copied to clipboard

Sometimes find_first() failed due to connection lost

Open jiceher opened this issue 6 years ago • 0 comments

Due to the fact that a device is no more accessible, the init of blinkstick class has no device and then the slf.bs_serial does not exist

Traceback (most recent call last): File "jenkins2.py", line 99, in main() File "jenkins2.py", line 95, in main blink(isFailed, isBuilding, isError) File "jenkins2.py", line 45, in blink bstick = blinkstick.find_first() File "/usr/local/lib/python2.7/dist-packages/blinkstick/blinkstick.py", line 1512, in find_first return BlinkStick(device=d) File "/usr/local/lib/python2.7/dist-packages/blinkstick/blinkstick.py", line 209, in init self.bs_serial = self.get_serial() File "/usr/local/lib/python2.7/dist-packages/blinkstick/blinkstick.py", line 272, in get_serial return self._usb_get_string(self.device, 256, 3) File "/usr/local/lib/python2.7/dist-packages/blinkstick/blinkstick.py", line 218, in _usb_get_string if self._refresh_device(): File "/usr/local/lib/python2.7/dist-packages/blinkstick/blinkstick.py", line 249, in _refresh_device d = find_by_serial(self.bs_serial) AttributeError: 'BlinkStick' object has no attribute 'bs_serial'

jiceher avatar Dec 05 '18 07:12 jiceher