Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put watchdog loop behind
__name__ == '__main__'
I've been running runtime-introspection tools (particularly stubtest) on docassemble's code base recently, and when you simply `import watchdog`, the tool will get stuck in an infinite loop because the only thing in the file is an infinite `while: True` loop. This patch puts that behind `if __name__ == '__main__'`, so only people who are running this module as the main module will get the desired infinite loop. The only documented way of running this module is through `run-watchdog.sh`, which runs `python -m docassemble.webapp.watchdog &`, so this shouldn't break any existing functionality.
- Loading branch information