Skip to content

Commit

Permalink
fix: handle WindowsPath object correctly in BaseSearcher._parse_source
Browse files Browse the repository at this point in the history
  • Loading branch information
polischuks committed Feb 7, 2025
1 parent d4cd7db commit 628cf88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hstest/testing/execution/searcher/base_searcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,11 @@ def _parse_source(self, source: str) -> tuple[Path, Path, Module]:
if source.name.endswith(ext):
source_folder = None
source_file = source
source_module = source[: -len(ext)].replace(os.sep, ".")
source_module = str(source)[:-len(ext)].replace(os.sep, ".")

elif os.sep in source:
elif os.sep in str(source):
if source.name.endswith(os.sep):
source = source[: -len(os.sep)]
source = str(source)[:-len(os.sep)]

source_folder = source
source_file = None
Expand Down

0 comments on commit 628cf88

Please sign in to comment.