Add files in a directory to a queue

def queue_files(dirpath, queue):
    """Add files in a directory to a queue"""
    for root, _, files in os.walk(os.path.abspath(dirpath)):
        if not files:
            continue
        for filename in files:
            queue.put(os.path.join(root, filename))