def _register_watcher(self, filepath, module_name):
     wm = WatchedModule(
         watcher=FileWatcher(filepath, self.on_file_changed),
         module_name=module_name,
     )
     self._watched_modules[filepath] = wm