Allow Requests.Response to be used as a context manager
Before adoption: this commit came in with the history the project adopted, so no landing records it.
This saves having to wrap the call to requests with `contextlib.closing()`, allowing it to be used directly in a `with` statement, like so: ``` with requests.get('http://httpbin.org/get', stream=True) as r: # Do things with the response here. ``` Fixes #4136.
authored by Ed Morley · committed by Ed Morley · parent 40ce814 · Browse files · 5 files+20 added−6 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+20 added−6 removed
- tests:+6 added−0 removed
- other:+14 added−6 removed