From d05bf7d628ff470dc5434277a680edca4c0dc5b4 Mon Sep 17 00:00:00 2001 From: Tal Einat <532281+taleinat@users.noreply.github.com> Date: Tue, 7 Jun 2022 00:30:00 +0300 Subject: [PATCH] lint --- src/watchdog/tricks/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/watchdog/tricks/__init__.py b/src/watchdog/tricks/__init__.py index 68fbe929..7aadcf0d 100644 --- a/src/watchdog/tricks/__init__.py +++ b/src/watchdog/tricks/__init__.py @@ -156,9 +156,8 @@ def on_any_event(self, event): else: process_watcher = ProcessWatcher(self.process, None) self._process_watchers.add(process_watcher) - def cleanup(): - self._process_watchers.discard(process_watcher) - process_watcher.process_termination_callback = cleanup + process_watcher.process_termination_callback = \ + functools.partial(self._process_watchers.discard, process_watcher) process_watcher.start() def is_process_running(self):