Remove deprecated asyncio coroutine decorator, handle session closing#5
Merged
Merged
Conversation
53 tasks
|
@titilambert could you take a look at this and merge/release it? It prevents us from adopting Python 3.11 |
Owner
|
@balloob Sorry for the delay. |
Owner
Owner
|
I'm currently asking the HA Quebec community if there is any user ... |
Contributor
Author
|
Thanks, @titilambert 👍 Don't forget to tag a release when ready, so we can upgrade the package on the Home Assistant end. ../Frenck |
Owner
Contributor
Author
|
I don't see usage on the public analytics of HA either. Yet, will bump for now and start an deprecation period after that. |
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This PR fixes #3, by converting the old
@asyncio.coroutine/yield fromsyntax to the new Python async/await syntax introduced in Python 3.5.This removes Python 3.4 compatibility but prepares for Python 3.10. I've adjusted the package classifiers to match that.
Additionally, added a small change that would not close a passed session. Only self-created sessions should be cleaned up/closed. This prevents the accidental closing of sessions not managed by this package.