def _restart_application_with_autoreload():
while True:
new_environ = os.environ.copy()
new_environ['RUN_MAIN_APP'] = 'true'
exit_code = os.spawnve(
os.P_WAIT,
sys.executable,
[sys.executable] + sys.argv,
new_environ
)
if exit_code != RELOAD_EXIT_CODE:
return exit_code
评论列表
文章目录