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

DeprecationWarning on Thread.setDaemon #182

Closed
wchistow opened this issue May 20, 2024 · 1 comment
Closed

DeprecationWarning on Thread.setDaemon #182

wchistow opened this issue May 20, 2024 · 1 comment

Comments

@wchistow
Copy link
Contributor

wchistow commented May 20, 2024

When running tests (make test), there is a DeprecationWarning on the setDaemon method (class threading.Thread):

tests/test_browser.py ..                                                                                                                                    [ 33%]
tests/test_events.py ...                                                                                                                                    [ 83%]
tests/test_markdown.py .                                                                                                                                    [100%]

======================================================================== warnings summary =========================================================================
tests/test_events.py::test_message_posted_event_initialization
tests/test_events.py::test_message_edited_event_initialization
tests/test_events.py::test_message_starred_event_initialization
  /.../ChatExchange/chatexchange/client.py:101: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
    self._thread.setDaemon(True)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================== 6 passed, 3 warnings in 0.58s ==================================================================

It is better to use thread.daemon = True instead of thread.setDaemon(True).

Note: the daemon attribute was added in Python 2.6

PR: #183

@wchistow
Copy link
Contributor Author

The pull request was merged, so I'm closing this issue.

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

No branches or pull requests

1 participant