(self)
| 378 | sys.exit(3) |
| 379 | |
| 380 | def run_step(self) -> None: |
| 381 | to_delete = set(self.watches) |
| 382 | |
| 383 | for path in _find_watchdog_paths(self.extra_files, self.exclude_patterns): |
| 384 | if path not in self.watches: |
| 385 | try: |
| 386 | self.watches[path] = self.observer.schedule( |
| 387 | self.event_handler, path, recursive=True |
| 388 | ) |
| 389 | except OSError: |
| 390 | # Clear this path from list of watches. We don't want |
| 391 | # the same error message showing again in the next |
| 392 | # iteration. |
| 393 | self.watches[path] = None |
| 394 | |
| 395 | to_delete.discard(path) |
| 396 | |
| 397 | for path in to_delete: |
| 398 | watch = self.watches.pop(path, None) |
| 399 | |
| 400 | if watch is not None: |
| 401 | self.observer.unschedule(watch) |
| 402 | |
| 403 | |
| 404 | reloader_loops: dict[str, type[ReloaderLoop]] = { |
no test coverage detected