Commit acf98ad
requests: Add context manager for response object.
When accessing response.raw it's not always obvious you should call
`response.close()` to close and free the socket. Since lwIP can have a
socket limit this can very quickly result in cryptic ENOMEM errors.
This matches the official requests which has the same context manager on
`Response` objects.
Signed-off-by: Phil Howard <github@gadgetoid.com>1 parent 4ac5958 commit acf98ad
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
35 | 41 | | |
36 | 42 | | |
37 | 43 | | |
| |||
0 commit comments