hidapi: fix infinite loop on some write errors

This commit is contained in:
Peter F. Patel-Schneider 2020-07-20 13:33:12 -04:00 committed by Filipe Laíns
parent e436b1bd1d
commit 204bc6e810
1 changed files with 1 additions and 1 deletions

View File

@ -280,8 +280,8 @@ def write(device_handle, data):
bytes_written = 0
while (retrycount < 3):
try:
bytes_written = _os.write(device_handle, data)
retrycount += 1
bytes_written = _os.write(device_handle, data)
except IOError as e:
if e.errno == _errno.EPIPE:
sleep(0.1)