pnijhara / gitsome

StopIteration detected in a generator PYL-R1708
Style
Major
4 years ago4 years old
Do not raise StopIteration in generator, use return statement instead
256    if state["pymode"][-1][0]:
257        return
258    # add a whitespace token after a redirection, if we need to
259    next_tok = next(state["stream"])260    if next_tok.start == token.end:
261        yield _new_token("WS", "", token.end)
262    yield from handle_token(state, next_tok)