def generator_next(g):
    """
        Return next elements in generator.
        :param g|generator:
        :rtype generator: return None if stopping iteration.
    """
    try:
        e = g.__next__()
        return e
    except StopIteration:
        return None