diff --git a/client/ayon_core/lib/path_tools.py b/client/ayon_core/lib/path_tools.py index 31baac168c..3826f1383e 100644 --- a/client/ayon_core/lib/path_tools.py +++ b/client/ayon_core/lib/path_tools.py @@ -136,8 +136,8 @@ def version_up(filepath): index += len(new_label) clash_basename = clash_basename[:index] - for file in os.listdir(dirname): - if file.endswith(ext) and file.startswith(clash_basename): + for file in os.scandir(dirname): + if file.name.endswith(ext) and file.name.startswith(clash_basename): log.info("Skipping existing version %s" % new_label) return version_up(new_filename)