-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix #60 #61
fix #60 #61
Conversation
Codecov Report
@@ Coverage Diff @@
## master #61 +/- ##
=========================================
Coverage ? 94.46%
=========================================
Files ? 20
Lines ? 1373
Branches ? 0
=========================================
Hits ? 1297
Misses ? 76
Partials ? 0
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the context manager is necessary to fix the issue. What do you think about handling an exception in an iterator and close response object?
async def __anext__(self):
try:
return await self.next()
except:
self.resp.close()
self.resp = None
raise
@tomplus The |
Yes, it makes sense, thanks for working on this! |
- test `release()` called
Released in v8.1.0, thank you. |
This PR adds async context manager support on
Watch
object, so the response is correctly closed when watch is stopped withstop()
or by some exceptions.fix #60