Skip to content

Commit

Permalink
Fix example remote_server_context (pymodbus-dev#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
dhoomakethu authored and wexi committed Nov 30, 2017
1 parent 3972c02 commit a460dd3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/contrib/remote_server_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def __init__(self, client):
'h': lambda a, v, s: client.write_registers(a, v, s),
'i': lambda a, v, s: client.write_registers(a, v, s),
}
self._client = client
self.slaves = {} # simply a cache

def __str__(self):
Expand All @@ -157,7 +158,7 @@ def __iter__(self):
:returns: An iterator over the slave contexts
'''
# note, this may not include all slaves
return self.__slaves.iteritems()
return iter(self.slaves.items())

def __contains__(self, slave):
''' Check if the given slave is in this list
Expand Down

0 comments on commit a460dd3

Please sign in to comment.