Skip to content

Commit

Permalink
Attempt to fix linux test
Browse files Browse the repository at this point in the history
  • Loading branch information
niradar committed Jun 19, 2024
1 parent fa40dee commit fff6255
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion duplicate_files_in_folders/file_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,11 @@ 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]

# 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:
"""
Expand Down

0 comments on commit fff6255

Please sign in to comment.