Spawn a new Python interpreter with the same arguments as the current one, but running the reloader thread.
(self)
| 264 | pass |
| 265 | |
| 266 | def restart_with_reloader(self) -> int: |
| 267 | """Spawn a new Python interpreter with the same arguments as the |
| 268 | current one, but running the reloader thread. |
| 269 | """ |
| 270 | while True: |
| 271 | _log("info", f" * Restarting with {self.name}") |
| 272 | args = _get_args_for_reloading() |
| 273 | new_environ = os.environ.copy() |
| 274 | new_environ["WERKZEUG_RUN_MAIN"] = "true" |
| 275 | exit_code = subprocess.call(args, env=new_environ, close_fds=False) |
| 276 | |
| 277 | if exit_code != 3: |
| 278 | return exit_code |
| 279 | |
| 280 | def trigger_reload(self, filename: str) -> None: |
| 281 | self.log_reload(filename) |
no test coverage detected