Skip to content

Commit d990a13

Browse files
dragoshenrondhoomakethu
authored andcommitted
Update concurrent_client.py - Python3 compatbility (#280)
iter.next() was removed in python 3 so the code is broken on line 218. This edit brings compatibility to python 3. Successfully tested with Pythin 2.7.13 and 3.5.3
1 parent ca10c1e commit d990a13

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/contrib/concurrent_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,10 @@ def execute(self, request):
214214
:param request: The request to execute
215215
:returns: A future linked to the call's response
216216
"""
217-
fut, work_id = Future(), self.counter.next()
217+
if IS_PYTHON3:
218+
fut, work_id = Future(), next(self.counter)
219+
else:
220+
fut, work_id = Future(), self.counter.next()
218221
self.input_queue.put(WorkRequest(request, work_id))
219222
self.futures[work_id] = fut
220223
return fut

0 commit comments

Comments
 (0)