udev: fix c52b + MX Master

Signed-off-by: Filipe Laíns <lains@archlinux.org>
This commit is contained in:
Filipe Laíns 2019-07-26 15:46:14 +01:00 committed by Filipe Laíns
parent 1bb08d011d
commit 6376980213
1 changed files with 5 additions and 3 deletions

View File

@ -264,10 +264,12 @@ def write(device_handle, data):
retrycount = 0
bytes_written = 0
while(retrycount < 3):
bytes_written = _os.write(device_handle, data)
if bytes_written != len(data):
sleep(0.1)
try:
bytes_written = _os.write(device_handle, data)
retrycount += 1
except IOError as e:
if e.errno == _errno.EPIPE:
sleep(0.1)
else:
break
if bytes_written != len(data):