Skip to content

Commit

Permalink
fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hcoffin-vecatom committed Sep 10, 2024
1 parent eeebd69 commit e461446
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions pyvisa_py/protocols/usbtmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,17 +481,17 @@ def read(self, size):
response = BulkInMessage.from_bytes(resp)
received.extend(response.data)
while len(resp) == self.usb_recv_ep.wMaxPacketSize:
# USBTMC Section 3.3 specifies that the first usb packet must contain the header
# the remaining packets do not need the header
# the message is finished when a "short packet" is sent (one whose length is less than wMaxPacketSize)
# USBTMC Section 3.3 specifies that the first usb packet
# must contain the header. the remaining packets do not need
# the header the message is finished when a "short packet"
# is sent (one whose length is less than wMaxPacketSize)
resp = raw_read(recv_chunk + header_size + max_padding)
received.extend(resp)
except (usb.core.USBError, ValueError):
# Abort failed Bulk-IN operation.
self._abort_bulk_in(self._btag)
raise


# Detect EOM only when device sends all expected bytes.
if len(response.data) >= response.transfer_size:
eom = response.transfer_attributes & 1
Expand Down
3 changes: 2 additions & 1 deletion pyvisa_py/usb.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ def _usb_reader():
return self._read(
_usb_reader,
count,
lambda current: False, # USBTMC can return partial message (i.e., before the term_char) or have trailing zeros
lambda current: False, # USBTMC can return partial message (i.e.,
# before the term_char) or have trailing zeros
supress_end_en,
term_char,
term_char_en,
Expand Down

0 comments on commit e461446

Please sign in to comment.