diff --git a/pymodbus/register_write_message.py b/pymodbus/register_write_message.py index 4ff21ac9c..b49db4901 100644 --- a/pymodbus/register_write_message.py +++ b/pymodbus/register_write_message.py @@ -132,9 +132,11 @@ def __init__(self, address=None, values=None, **kwargs): ''' ModbusRequest.__init__(self, **kwargs) self.address = address - self.values = values or [] - if not hasattr(values, '__iter__'): - self.values = [values] + if values is None: + values = [] + elif not hasattr(values, '__iter__'): + values = [values] + self.values = values self.count = len(self.values) self.byte_count = self.count * 2