diff --git a/lib/tfw/components/source_code_event_handler.py b/lib/tfw/components/source_code_event_handler.py index 65232d2..4915887 100644 --- a/lib/tfw/components/source_code_event_handler.py +++ b/lib/tfw/components/source_code_event_handler.py @@ -71,7 +71,9 @@ class SourceCodeEventHandler(TriggerlessEventHandler): return self._monitor def reload_monitor(self): - if self._monitor: self._monitor.stop() + if self._monitor: + try: self._monitor.stop() + except KeyError: logging.debug('Working directory was removed – ignoring...') self._monitor = DirectoryMonitor(self.filemanager.workdir) self._monitor.watch() # This runs on a separate thread