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

devserver: use daemon property instead of deprecated setDaemon #979

Merged
merged 2 commits into from Jan 4, 2022

Conversation

yagebu
Copy link
Contributor

@yagebu yagebu commented Jan 4, 2022

threading.setDaemon is deprecated since Python 3.10

@yagebu yagebu merged commit 8a32396 into lektor:master Jan 4, 2022
@yagebu yagebu deleted the fix-setDaemon-deprecation branch January 4, 2022 15:30
@@ -99,7 +94,7 @@ def browse():
webbrowser.open("http://%s:%s" % addr)

t = threading.Thread(target=browse)
t.setDaemon(True)
t.daemon = True
Copy link
Contributor

@dairiki dairiki Jan 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One can pass a daemon kwarg to Thread.__init__. E.g.:

t = threading.Thread(target=browse, daemon=True)
t.start()

or even

threading.Thread(target=browse, daemon=True).start()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good to know. In the other case the BackgroundBuilder class should probably already do that itself.

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.

None yet

2 participants