From dab199452ab4bd4a2f143586a2b83c10708825d8 Mon Sep 17 00:00:00 2001 From: Nir Date: Wed, 19 Jun 2024 16:31:01 +0300 Subject: [PATCH] cleaned leftovers --- duplicate_files_in_folders/file_manager.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/duplicate_files_in_folders/file_manager.py b/duplicate_files_in_folders/file_manager.py index 0295cdc..ee777d0 100644 --- a/duplicate_files_in_folders/file_manager.py +++ b/duplicate_files_in_folders/file_manager.py @@ -99,13 +99,8 @@ def is_allowed_path(self, path: str | Path) -> bool: if not self.allowed_dirs: return True # If allowed_dirs is an empty set, all paths are allowed - # resolve all path parents - path_parents = [p.resolve() for p in path.parents] - - logger.debug(f"path: {path}, path_parents: {path_parents}, allowed_dirs: {self.allowed_dirs}") - # True if the path is in any of the allowed directories - return any(path == allowed_dir or allowed_dir in path_parents for allowed_dir in self.allowed_dirs) + return any(path == allowed_dir or allowed_dir in path.parents for allowed_dir in self.allowed_dirs) def move_file(self, src: str, dst: str) -> bool: """