-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
ClientSession.__aexit__ returns ClientSession.close coroutine #2064
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2064 +/- ##
==========================================
+ Coverage 97.08% 97.08% +<.01%
==========================================
Files 38 38
Lines 7684 7689 +5
Branches 1343 1344 +1
==========================================
+ Hits 7460 7465 +5
Misses 102 102
Partials 122 122
Continue to review full report at Codecov.
|
aiohttp/client.py
Outdated
def __aexit__(self, exc_type, exc_val, exc_tb): | ||
self.close() | ||
return self.close() |
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.
Why return
? I think it should be yield from
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 have done timeit
for those two cases, and your variant is faster. Fixed it.
…aio-libs#2064)" This reverts commit 4ecb633.
What do these changes do?
Correct session closing for asynchronous context manager.
Related issue number
#2063
Checklist
changes
folder<issue_id>.<type>
for example (588.bug)issue_id
change it to the pr id after creating the pr.feature
: Signifying a new feature..bugfix
: Signifying a bug fix..doc
: Signifying a documentation improvement..removal
: Signifying a deprecation or removal of public API..misc
: A ticket has been closed, but it is not of interest to users.