Skip to content

Commit 2bbb5e5

Browse files
authored
Fix example remote_server_context (#236)
Fix #234 Note to #190
1 parent 01f5819 commit 2bbb5e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/contrib/remote_server_context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ def __init__(self, client):
141141
'h': lambda a, v, s: client.write_registers(a, v, s),
142142
'i': lambda a, v, s: client.write_registers(a, v, s),
143143
}
144+
self._client = client
144145
self.slaves = {} # simply a cache
145146

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

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

0 commit comments

Comments
 (0)