Skip to content

Commit c820308

Browse files
author
Jennings Zhang
committed
Fix bug where left and right file are the same
1 parent 6863054 commit c820308

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

surfigures/inputs/find.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,5 @@ def _is_side_folder(folder: Path, side: str) -> bool:
183183

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

0 commit comments

Comments
 (0)