If we're going through a syntax error, add the directory of the error to
    the watchlist.

def _list_syntax_error():
    """
    If we're going through a syntax error, add the directory of the error to
    the watchlist.
    """

    _, e, _ = sys.exc_info()
    if isinstance(e, SyntaxError) and hasattr(e, 'filename'):
        yield path.dirname(e.filename)