A context that temporarily extends sys.path and reverts it after the
       context is complete.

def extender(path=None, cache=None):
    """A context that temporarily extends sys.path and reverts it after the
       context is complete."""
    old_path = sys.path[:]
    extend(path, cache=None)

    try:
        yield
    finally:
        sys.path = old_path