Skip to content

Commit

Permalink
fix (#1364): explicit cast all Paths to str
Browse files Browse the repository at this point in the history
  • Loading branch information
Lancetnik committed Apr 11, 2024
1 parent f3f8214 commit aaae9af
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions faststream/cli/supervisors/watchfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,19 @@ def __init__(
)

def startup(self) -> None:
logger.info(f"Will watch for changes in these directories: {self.reload_dirs}")
logger.info(
"Will watch for changes in these directories: %s",
[str(i) for i in self.reload_dirs],
)
super().startup()

def should_restart(self) -> bool:
for changes in self.watcher: # pragma: no branch
if changes: # pragma: no branch
unique_paths = {Path(c[1]).name for c in changes}
message = "WatchReloader detected file change in '%s'. Reloading..."
logger.info(message % tuple(unique_paths))
unique_paths = {str(Path(c[1]).name) for c in changes}
logger.info(
"WatchReloader detected file change in '%s'. Reloading...",
", ".join(unique_paths),
)
return True
return False # pragma: no cover

0 comments on commit aaae9af

Please sign in to comment.