Skip to content

Commit

Permalink
Fix bug where left and right file are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
jennydaman committed Apr 14, 2023
1 parent 6863054 commit c820308
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion surfigures/inputs/find.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,5 +183,5 @@ def _is_side_folder(folder: Path, side: str) -> bool:

def _corresponding_right_path_to(path: Path) -> Optional[Path]:
possible_paths = map(lambda l, r: path.with_name(path.name.replace(l, r)), constants.LEFT_WORDS, constants.RIGHT_WORDS)
existing_right_paths = filter(lambda f: f.exists(), possible_paths)
existing_right_paths = filter(lambda f: f.exists() and f != path, possible_paths)
return next(existing_right_paths, None)

0 comments on commit c820308

Please sign in to comment.