Skip to content

Commit

Permalink
Fix example remote_server_context (#236)
Browse files Browse the repository at this point in the history
Fix #234 
Note to #190
  • Loading branch information
dhoomakethu committed Dec 21, 2017
1 parent 58bf9e7 commit 019e9e0
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 019e9e0

Please sign in to comment.