def breadth(dirs):
    """
    Crawl through directories like os.walk, but use a 'breadth first' approach
    (os.walk uses 'depth first')
    """
    while dirs:
        next_dirs = []
        print("Dirs: '{}'".format(dirs))
        for d in dirs:
            next_dirs = []
            try:
                for name in os.listdir(d):
                    p = os.path.join(d, name)
                    if os.path.isdir(p):
                        print(p)
                        next_dirs.append(p)
            except PermissionError as nallowed:
                print(nallowed)
        dirs = next_dirs
        if dirs:
            yield dirs