Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions stdlib/3/http/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ from typing import (
Any, Dict, IO, Iterable, List, Iterator, Mapping, Optional, Tuple, Type, TypeVar,
Union,
overload,
BinaryIO,
)
import email.message
import io
Expand Down Expand Up @@ -79,7 +80,8 @@ responses = ... # type: Dict[int, str]
class HTTPMessage(email.message.Message): ...

if sys.version_info >= (3, 5):
class HTTPResponse(io.BufferedIOBase):
# Ignore errors to work around python/mypy#5027
class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore
msg = ... # type: HTTPMessage
headers = ... # type: HTTPMessage
version = ... # type: int
Expand All @@ -103,7 +105,7 @@ if sys.version_info >= (3, 5):
exc_val: Optional[BaseException],
exc_tb: Optional[types.TracebackType]) -> bool: ...
else:
class HTTPResponse:
class HTTPResponse(BinaryIO):
msg = ... # type: HTTPMessage
headers = ... # type: HTTPMessage
version = ... # type: int
Expand All @@ -122,8 +124,8 @@ else:
def fileno(self) -> int: ...
def __iter__(self) -> Iterator[bytes]: ...
def __enter__(self) -> 'HTTPResponse': ...
def __exit__(self, exc_type: Optional[type],
exc_val: Optional[Exception],
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[types.TracebackType]) -> bool: ...

class HTTPConnection:
Expand Down