diff --git a/src/watchdog/utils/process_watcher.py b/src/watchdog/utils/process_watcher.py index dd4ece58..46717bc7 100644 --- a/src/watchdog/utils/process_watcher.py +++ b/src/watchdog/utils/process_watcher.py @@ -21,6 +21,7 @@ def run(self): return try: - self.process_termination_callback() + if not self.stopped_event.is_set(): + self.process_termination_callback() except Exception: logger.exception("Error calling process termination callback")