Skip to content

Commit 1e09636

Browse files
committed
FileWatcher: Don't type-check changes
This check is unnecessary, as the underlying library is typed. This is not really signaling the closing of the "channel". Fixes #54. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent dec98e1 commit 1e09636

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/frequenz/channels/util/_file_watcher.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from watchfiles import Change, awatch
1111
from watchfiles.main import FileChange
1212

13-
from .._base_classes import ChannelClosedError, Receiver
13+
from .._base_classes import Receiver
1414

1515

1616
class FileWatcher(Receiver[pathlib.Path]):
@@ -90,8 +90,6 @@ def consume(self) -> pathlib.Path:
9090
assert self._changes, "calls to `consume()` must be follow a call to `ready()`"
9191
change = self._changes.pop()
9292
# Tuple of (Change, path) returned by watchfiles
93-
if change is None or len(change) != 2:
94-
raise ChannelClosedError()
9593
_, path_str = change
9694
path = pathlib.Path(path_str)
9795
return path

0 commit comments

Comments
 (0)