diff --git a/pyvisa-py/serial.py b/pyvisa-py/serial.py index 36ff2ab4..6818f891 100644 --- a/pyvisa-py/serial.py +++ b/pyvisa-py/serial.py @@ -67,8 +67,8 @@ def after_parsing(self): self.interface = cls(port=self.parsed.board, timeout=2000, writeTimeout=2000) - for name in 'ASRL_END_IN,ASRL_END_OUT,SEND_END_EN,TERMCHAR,' \ - 'TERMCHAR_EN,SUPPRESS_END_EN'.split(','): + for name in ('ASRL_END_IN', 'ASRL_END_OUT', 'SEND_END_EN', 'TERMCHAR', + 'TERMCHAR_EN', 'SUPPRESS_END_EN'): attribute = getattr(constants, 'VI_ATTR_' + name) self.attrs[attribute] = attributes.AttributesByID[attribute].default diff --git a/pyvisa-py/tcpip.py b/pyvisa-py/tcpip.py index a862ef85..446769a8 100644 --- a/pyvisa-py/tcpip.py +++ b/pyvisa-py/tcpip.py @@ -64,7 +64,7 @@ def after_parsing(self): self.link = link self.max_recv_size = min(max_recv_size, 2 ** 30) # 1GB - for name in 'SEND_END_EN,TERMCHAR,TERMCHAR_EN'.split(','): + for name in ('SEND_END_EN', 'TERMCHAR', 'TERMCHAR_EN'): attribute = getattr(constants, 'VI_ATTR_' + name) self.attrs[attribute] = attributes.AttributesByID[attribute].default @@ -345,7 +345,7 @@ def after_parsing(self): self.attrs[constants.VI_ATTR_TCPIP_PORT] = self.parsed.port self.attrs[constants.VI_ATTR_INTF_NUM] = self.parsed.board - for name in 'TERMCHAR,TERMCHAR_EN'.split(','): + for name in ('TERMCHAR', 'TERMCHAR_EN'): attribute = getattr(constants, 'VI_ATTR_' + name) self.attrs[attribute] = attributes.AttributesByID[attribute].default diff --git a/pyvisa-py/usb.py b/pyvisa-py/usb.py index 0a3fc4bc..2b2c6f95 100644 --- a/pyvisa-py/usb.py +++ b/pyvisa-py/usb.py @@ -194,7 +194,7 @@ def after_parsing(self): int(self.parsed.model_code, 0), self.parsed.serial_number) - for name in 'SEND_END_EN,TERMCHAR,TERMCHAR_EN'.split(','): + for name in ('SEND_END_EN', 'TERMCHAR', 'TERMCHAR_EN'): attribute = getattr(constants, 'VI_ATTR_' + name) self.attrs[attribute] = attributes.AttributesByID[attribute].default @@ -228,6 +228,6 @@ def after_parsing(self): int(self.parsed.model_code, 0), self.parsed.serial_number) - for name in 'SEND_END_EN,TERMCHAR,TERMCHAR_EN'.split(','): + for name in ('SEND_END_EN', 'TERMCHAR', 'TERMCHAR_EN'): attribute = getattr(constants, 'VI_ATTR_' + name) self.attrs[attribute] = attributes.AttributesByID[attribute].default