From 3fa3917a206413baa73c9cfa15907458963fdfdb Mon Sep 17 00:00:00 2001 From: Alex Forencich Date: Mon, 20 Jul 2015 12:48:20 -0700 Subject: [PATCH] VXI11 protocol performance enhancement --- pyvisa-py/tcpip.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyvisa-py/tcpip.py b/pyvisa-py/tcpip.py index ea492af6..a862ef85 100644 --- a/pyvisa-py/tcpip.py +++ b/pyvisa-py/tcpip.py @@ -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 @@ -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: @@ -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.