mirror of
https://github.com/Lekensteyn/lglaf.git
synced 2025-02-19 19:14:53 -05:00
lglaf.py: fix default read timeout
Really apply default read timeout (5 seconds) even if Communication.read passes None.
This commit is contained in:
parent
6c1f8e78c9
commit
7ef3448209
1 changed files with 3 additions and 1 deletions
4
lglaf.py
4
lglaf.py
|
@ -230,7 +230,9 @@ class USBCommunication(Communication):
|
|||
def _match_configuration(self, config):
|
||||
return usb.util.find_descriptor(config,
|
||||
custom_match=self._match_interface)
|
||||
def _read(self, n, timeout=READ_TIMEOUT_MS):
|
||||
def _read(self, n, timeout=None):
|
||||
if timeout is None:
|
||||
timeout = self.READ_TIMEOUT_MS
|
||||
# device seems to use 16 KiB buffers.
|
||||
array = self.usbdev.read(self.EP_IN, 2**14, timeout=timeout)
|
||||
try: return array.tobytes()
|
||||
|
|
Loading…
Reference in a new issue