def walk_parents(path):
    """Walks up the tree to the root directory."""
    while os.path.splitdrive(path)[1] != os.sep:
        yield path
        path = os.path.dirname(path)
dataset/ETHPy150Open reviewboard/rbtools/rbtools/utils/filesystem.py/walk_parents/original