def METHOD_NAME(readline):
    """wrap generate_tokens to catch EOF errors"""
    try:
        for token in tokenize.METHOD_NAME(readline):
            yield token
    except tokenize.TokenError:
        # catch EOF error
        return