Skip to content

Commit

Permalink
cast path to string
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhujus committed Sep 20, 2024
1 parent 8360195 commit e946cb9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion samcli/lib/sync/watch_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ def on_code_change(event: Optional[FileSystemEvent] = None) -> None:
#
# It looks like the other way a folder modified event can happen
# is if the permissions of the folder were changed
LOG.debug(f"Ignoring file system MODIFIED event for folder {event.src_path}")
LOG.debug(f"Ignoring file system MODIFIED event for folder {event.src_path!r}")
return

# sync flow factory should always exist, but guarding just incase
Expand Down
6 changes: 3 additions & 3 deletions samcli/lib/utils/file_observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from abc import ABC, abstractmethod
from pathlib import Path
from threading import Lock, Thread
from typing import Callable, Dict, List, Optional
from typing import Callable, Dict, List, Optional, cast

import docker
from docker import DockerClient
Expand Down Expand Up @@ -460,10 +460,10 @@ def on_change(self, event: FileSystemEvent) -> None:
path
for path in _observed_paths
if path == event.src_path
or path in self._watch_dog_observed_paths.get(f"{event.src_path}_False", [])
or path in self._watch_dog_observed_paths.get(f"{event.src_path!r}_False", [])
]
else:
observed_paths = [path for path in _observed_paths if event.src_path.startswith(path)]
observed_paths = [path for path in _observed_paths if cast(str, event.src_path).startswith(path)]

if not observed_paths:
continue
Expand Down

0 comments on commit e946cb9

Please sign in to comment.