Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Jul 28, 2024
1 parent 4ae786c commit d467f21
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/watchdog/observers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,7 @@ def schedule(self, event_handler, path, recursive=False, event_filter=None):

# If we don't have an emitter for this watch already, create it.
if self._emitter_for_watch.get(watch) is None:
emitter = self._emitter_class(
event_queue=self.event_queue,
watch=watch,
timeout=self.timeout,
event_filter=event_filter,
)
emitter = self._emitter_class(self.event_queue, watch, timeout=self.timeout, event_filter=event_filter)
if self.is_alive():
emitter.start()
self._add_emitter(emitter)
Expand Down
2 changes: 1 addition & 1 deletion src/watchdog/observers/fsevents.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def queue_events(self, timeout, events):
if logger.getEffectiveLevel() <= logging.DEBUG:
for event in events:
flags = ", ".join(attr for attr in dir(event) if getattr(event, attr) is True)
logger.debug("{}: {}", event, flags)
logger.debug("%s: %s", event, flags)

if time.monotonic() - self._start_time > 60:
# Event history is no longer needed, let's free some memory.
Expand Down
2 changes: 1 addition & 1 deletion src/watchdog/observers/fsevents2.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def stop(self):

def _callback(self, streamRef, clientCallBackInfo, numEvents, eventPaths, eventFlags, eventIDs):
events = [NativeEvent(path, flags, _id) for path, flags, _id in zip(eventPaths, eventFlags, eventIDs)]
logger.debug("FSEvents callback. Got {} events:", numEvents)
logger.debug("FSEvents callback. Got %d events:", numEvents)
for e in events:
logger.debug(e)
self._queue.put(events)
Expand Down

0 comments on commit d467f21

Please sign in to comment.