Skip to content

Commit

Permalink
VXI11 protocol performance enhancement
Browse files Browse the repository at this point in the history
  • Loading branch information
alexforencich committed Jul 20, 2015
1 parent ef0fc09 commit 3fa3917
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyvisa-py/tcpip.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def read(self, count):
flags = vxi11.OP_FLAG_TERMCHAR_SET
term_char = str(term_char).encode('utf-8')[0]

read_data = b''
read_data = bytearray()

end_reason = vxi11.RX_END | vxi11.RX_CHR

Expand All @@ -115,7 +115,7 @@ def read(self, count):
if error:
return read_data, StatusCode.error_io

read_data += data
read_data.extend(data)
count -= len(data)

if count <= 0:
Expand All @@ -124,7 +124,7 @@ def read(self, count):

chunk_length = min(count, chunk_length)

return read_data, status
return bytes(read_data), status

def write(self, data):
"""Writes data to device or interface synchronously.
Expand Down

0 comments on commit 3fa3917

Please sign in to comment.