MCPcopy
hub / github.com/pallets/werkzeug / restart_with_reloader

Method restart_with_reloader

src/werkzeug/_reloader.py:266–278  ·  view source on GitHub ↗

Spawn a new Python interpreter with the same arguments as the current one, but running the reloader thread.

(self)

Source from the content-addressed store, hash-verified

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)

Callers 1

run_with_reloaderFunction · 0.80

Calls 3

_logFunction · 0.85
_get_args_for_reloadingFunction · 0.85
copyMethod · 0.45

Tested by

no test coverage detected