Skip to content

Commit feebd9f

Browse files
committed
fix server
1 parent 6292b57 commit feebd9f

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/htmlcmp/compare_output_server.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def init_compare(a: Path, b: Path):
5252
if not a.is_dir() or not b.is_dir():
5353
raise ValueError("Both paths must be directories")
5454

55-
common_path = a / Config.path_a
55+
common_path = a.relative_to(Config.path_a)
5656

5757
left = sorted(p.name for p in a.iterdir())
5858
right = sorted(p.name for p in b.iterdir())
@@ -106,8 +106,6 @@ def submit(self, path: Path):
106106
def compare(self, path: Path):
107107
if not isinstance(path, Path):
108108
raise TypeError("Path must be of type Path")
109-
if not path.is_file():
110-
raise ValueError("Path must be a file")
111109
if path not in self._future:
112110
raise RuntimeError("Path not submitted for comparison")
113111

@@ -166,7 +164,7 @@ def print_tree(a: Path, b: Path):
166164
if not a.is_dir() or not b.is_dir():
167165
raise ValueError("Both paths must be directories")
168166

169-
common_path = a / Config.path_a
167+
common_path = a.relative_to(Config.path_a)
170168

171169
left = sorted(p.name for p in a.iterdir())
172170
right = sorted(p.name for p in b.iterdir())

0 commit comments

Comments
 (0)