From aafa556a10b5c5f559fe2e8c02259977ec0dbd9a Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi Date: Wed, 1 Nov 2017 16:19:43 +0100 Subject: [PATCH] Add context manager methods to requests.Response (#1701) * Add context manager methods to requests.Response * Simplified the requests.Response.__exit__ signature --- third_party/2and3/requests/models.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/third_party/2and3/requests/models.pyi b/third_party/2and3/requests/models.pyi index 18b16894c..b3f904008 100644 --- a/third_party/2and3/requests/models.pyi +++ b/third_party/2and3/requests/models.pyi @@ -2,6 +2,7 @@ from typing import Any, List, MutableMapping, Iterator, Dict, Text import datetime +import types from . import hooks from . import structures @@ -114,6 +115,8 @@ class Response: def __bool__(self) -> bool: ... def __nonzero__(self) -> bool: ... def __iter__(self) -> Iterator[bytes]: ... + def __enter__(self) -> Response: ... + def __exit__(self, *args: Any) -> None: ... @property def ok(self) -> bool: ... @property