If you want, you could replace `os.path.isfile(path(source_dir) / root[0])` with `(path(source_dir) / root[0]).isfile()`