Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Matthieu Dartiailh <[email protected]>
  • Loading branch information
Jimmyvandenbergh and MatthieuDartiailh authored Nov 13, 2024
1 parent 29173c4 commit 615aa20
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyvisa_py/protocols/usbtmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,12 +494,12 @@ def read(self, size):
resp = raw_read(recv_chunk + header_size + max_padding)
received_transfer.extend(resp)

# Detect EOM only when device sends all expected bytes.
# Detect EOM only when device sends all expected bytes.
if len(received_transfer) >= response.transfer_size:
eom = response.transfer_attributes & 1
# Truncate data to the specified length (discard padding)
# USBTMC header (12 bytes) has already truncated
received_message = received_transfer[: response.transfer_size]
received_message.extend(received_transfer[: response.transfer_size])
except (usb.core.USBError, ValueError):
# Abort failed Bulk-IN operation.
self._abort_bulk_in(self._btag)
Expand Down

0 comments on commit 615aa20

Please sign in to comment.