Skip to content

Commit

Permalink
Merge pull request #695 from prospector-dev/path-error
Browse files Browse the repository at this point in the history
Fix path list in error
  • Loading branch information
sbrunner authored Oct 26, 2024
2 parents bab605b + bd1622c commit e8137d6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions prospector/profiles/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
from pathlib import Path


class ProfileNotFound(Exception):
def __init__(self, name: str, profile_path: str) -> None:
def __init__(self, name: str, profile_path: list[Path]) -> None:
super().__init__()
self.name = name
self.profile_path = profile_path

def __repr__(self) -> str:
return "Could not find profile {}; searched in {}".format(
self.name,
":".join(self.profile_path),
":".join(map(str, self.profile_path)),
)


Expand Down
2 changes: 1 addition & 1 deletion prospector/profiles/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def _load_content(name_or_path: Union[str, Path], profile_path: list[Path]) -> d
if optional:
return {}

raise ProfileNotFound(str(name_or_path), str(profile_path))
raise ProfileNotFound(str(name_or_path), profile_path)

with codecs.open(filename) as fct:
try:
Expand Down

0 comments on commit e8137d6

Please sign in to comment.