Skip to content

Commit

Permalink
hidapi: fix infinite loop on some write errors
Browse files Browse the repository at this point in the history
  • Loading branch information
pfps authored and FFY00 committed Jul 20, 2020
1 parent e436b1b commit 204bc6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/hidapi/udev.py
Expand Up @@ -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)
Expand Down

0 comments on commit 204bc6e

Please sign in to comment.