def source(script):
    """
    Sources a shell script at a given path, updating the environment.
    """
    pipe = sp.Popen(". %s; env" % script, stdout=sp.PIPE, shell=True)
    data = pipe.communicate()[0]
    env = dict((line.split("=", 1) for line in data.splitlines()))
    os.environ.update(env)
dataset/ETHPy150Open ros-infrastructure/rosdep/test/test_rosdep_issue30.py/source/original