Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoreload: Various updates #3302

Merged
merged 8 commits into from
Jul 27, 2023
Merged

Conversation

bdarnell
Copy link
Member

Running a directory has some but not all of the behavior of
running a module, including setting __spec__, so we must be careful
not to break things by assuming that __spec__ means module mode.

Fixes tornadoweb#2855
This will make it easier to add other options (for tornadoweb#2398)
A previous commit added support for using autoreload within programs
that were started as directories; this commit supports them when
run with the -m tornado.autoreload wrapper.

This change may have side effects for file mode since we now use
runpy.run_path instead of executing the file by hand (I don't think
the run_path function existed when this code was originally written).
This flag terminates the autoreload loop after the first successful
run. This makes it possible to cleanly shut down a process that is using
"python -m tornado.autoreload" without printing a traceback.

Fixes tornadoweb#2398
@bdarnell bdarnell merged commit 1adf629 into tornadoweb:master Jul 27, 2023
10 checks passed
@bdarnell bdarnell deleted the autoreload-updates branch July 27, 2023 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant