Skip to content

Commit 628cf88

Browse files
committed
fix: handle WindowsPath object correctly in BaseSearcher._parse_source
1 parent d4cd7db commit 628cf88

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

hstest/testing/execution/searcher/base_searcher.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ def _parse_source(self, source: str) -> tuple[Path, Path, Module]:
253253
if source.name.endswith(ext):
254254
source_folder = None
255255
source_file = source
256-
source_module = source[: -len(ext)].replace(os.sep, ".")
256+
source_module = str(source)[:-len(ext)].replace(os.sep, ".")
257257

258-
elif os.sep in source:
258+
elif os.sep in str(source):
259259
if source.name.endswith(os.sep):
260-
source = source[: -len(os.sep)]
260+
source = str(source)[:-len(os.sep)]
261261

262262
source_folder = source
263263
source_file = None

0 commit comments

Comments
 (0)