Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions vxi11/vxi11.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,17 @@ def write_raw(self, data):

block = data[offset:offset+self.max_recv_size]

error, size = self.client.device_write(
self.link,
self._timeout_ms,
self._lock_timeout_ms,
flags,
block
)
try:
error, size = self.client.device_write(
self.link,
self._timeout_ms,
self._lock_timeout_ms,
flags,
block
)
except KeyboardInterrupt:
self.link = None
raise

if error:
raise Vxi11Exception(error, 'write')
Expand Down Expand Up @@ -714,15 +718,19 @@ def read_raw(self, num=-1):
read_data = bytearray()

while reason & (RX_END | RX_CHR) == 0:
error, reason, data = self.client.device_read(
self.link,
read_len,
self._timeout_ms,
self._lock_timeout_ms,
flags,
term_char
)

try:
error, reason, data = self.client.device_read(
self.link,
read_len,
self._timeout_ms,
self._lock_timeout_ms,
flags,
term_char
)
except KeyboardInterrupt:
self.link = None
raise

if error:
raise Vxi11Exception(error, 'read')

Expand Down