def __next__(self):
if self._fut is None:<EOL><INDENT>self._fut = self._iter.getq()<EOL><DEDENT>try:<EOL><INDENT>try:<EOL><INDENT>(ent,<EOL>self._cursor_before,<EOL>self._cursor_after,<EOL>self._more_results) = self._fut.get_result()<EOL>return ent<EOL><DEDENT>except EOFError:<EOL><INDENT>self._exhausted = True<EOL>raise StopIteration<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>self._fut = None<EOL><DEDENT>
Iterator protocol: get next item or raise StopIteration.