Remove Python 3.4 support (#3147)

Closes #3123
This commit is contained in:
Sebastian Rittau
2019-07-27 10:58:21 +02:00
committed by GitHub
parent 4697adcb1a
commit 9ccf9356bf
55 changed files with 988 additions and 1266 deletions

View File

@@ -2,68 +2,66 @@ import sys
from enum import IntEnum
if sys.version_info >= (3, 5):
class HTTPStatus(IntEnum):
class HTTPStatus(IntEnum):
def __init__(self, *a) -> None: ...
def __init__(self, *a) -> None: ...
phrase: str
description: str
phrase: str
description: str
CONTINUE = ...
SWITCHING_PROTOCOLS = ...
PROCESSING = ...
OK = ...
CREATED = ...
ACCEPTED = ...
NON_AUTHORITATIVE_INFORMATION = ...
NO_CONTENT = ...
RESET_CONTENT = ...
PARTIAL_CONTENT = ...
MULTI_STATUS = ...
ALREADY_REPORTED = ...
IM_USED = ...
MULTIPLE_CHOICES = ...
MOVED_PERMANENTLY = ...
FOUND = ...
SEE_OTHER = ...
NOT_MODIFIED = ...
USE_PROXY = ...
TEMPORARY_REDIRECT = ...
PERMANENT_REDIRECT = ...
BAD_REQUEST = ...
UNAUTHORIZED = ...
PAYMENT_REQUIRED = ...
FORBIDDEN = ...
NOT_FOUND = ...
METHOD_NOT_ALLOWED = ...
NOT_ACCEPTABLE = ...
PROXY_AUTHENTICATION_REQUIRED = ...
REQUEST_TIMEOUT = ...
CONFLICT = ...
GONE = ...
LENGTH_REQUIRED = ...
PRECONDITION_FAILED = ...
REQUEST_ENTITY_TOO_LARGE = ...
REQUEST_URI_TOO_LONG = ...
UNSUPPORTED_MEDIA_TYPE = ...
REQUESTED_RANGE_NOT_SATISFIABLE = ...
EXPECTATION_FAILED = ...
UNPROCESSABLE_ENTITY = ...
LOCKED = ...
FAILED_DEPENDENCY = ...
UPGRADE_REQUIRED = ...
PRECONDITION_REQUIRED = ...
TOO_MANY_REQUESTS = ...
REQUEST_HEADER_FIELDS_TOO_LARGE = ...
INTERNAL_SERVER_ERROR = ...
NOT_IMPLEMENTED = ...
BAD_GATEWAY = ...
SERVICE_UNAVAILABLE = ...
GATEWAY_TIMEOUT = ...
HTTP_VERSION_NOT_SUPPORTED = ...
VARIANT_ALSO_NEGOTIATES = ...
INSUFFICIENT_STORAGE = ...
LOOP_DETECTED = ...
NOT_EXTENDED = ...
NETWORK_AUTHENTICATION_REQUIRED = ...
CONTINUE = ...
SWITCHING_PROTOCOLS = ...
PROCESSING = ...
OK = ...
CREATED = ...
ACCEPTED = ...
NON_AUTHORITATIVE_INFORMATION = ...
NO_CONTENT = ...
RESET_CONTENT = ...
PARTIAL_CONTENT = ...
MULTI_STATUS = ...
ALREADY_REPORTED = ...
IM_USED = ...
MULTIPLE_CHOICES = ...
MOVED_PERMANENTLY = ...
FOUND = ...
SEE_OTHER = ...
NOT_MODIFIED = ...
USE_PROXY = ...
TEMPORARY_REDIRECT = ...
PERMANENT_REDIRECT = ...
BAD_REQUEST = ...
UNAUTHORIZED = ...
PAYMENT_REQUIRED = ...
FORBIDDEN = ...
NOT_FOUND = ...
METHOD_NOT_ALLOWED = ...
NOT_ACCEPTABLE = ...
PROXY_AUTHENTICATION_REQUIRED = ...
REQUEST_TIMEOUT = ...
CONFLICT = ...
GONE = ...
LENGTH_REQUIRED = ...
PRECONDITION_FAILED = ...
REQUEST_ENTITY_TOO_LARGE = ...
REQUEST_URI_TOO_LONG = ...
UNSUPPORTED_MEDIA_TYPE = ...
REQUESTED_RANGE_NOT_SATISFIABLE = ...
EXPECTATION_FAILED = ...
UNPROCESSABLE_ENTITY = ...
LOCKED = ...
FAILED_DEPENDENCY = ...
UPGRADE_REQUIRED = ...
PRECONDITION_REQUIRED = ...
TOO_MANY_REQUESTS = ...
REQUEST_HEADER_FIELDS_TOO_LARGE = ...
INTERNAL_SERVER_ERROR = ...
NOT_IMPLEMENTED = ...
BAD_GATEWAY = ...
SERVICE_UNAVAILABLE = ...
GATEWAY_TIMEOUT = ...
HTTP_VERSION_NOT_SUPPORTED = ...
VARIANT_ALSO_NEGOTIATES = ...
INSUFFICIENT_STORAGE = ...
LOOP_DETECTED = ...
NOT_EXTENDED = ...
NETWORK_AUTHENTICATION_REQUIRED = ...

View File

@@ -80,61 +80,34 @@ responses: Dict[int, str]
class HTTPMessage(email.message.Message): ...
if sys.version_info >= (3, 5):
# Ignore errors to work around python/mypy#5027
class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore
msg: HTTPMessage
headers: HTTPMessage
version: int
debuglevel: int
closed: bool
status: int
reason: str
def __init__(self, sock: socket, debuglevel: int = ...,
method: Optional[str] = ..., url: Optional[str] = ...) -> None: ...
def read(self, amt: Optional[int] = ...) -> bytes: ...
@overload
def getheader(self, name: str) -> Optional[str]: ...
@overload
def getheader(self, name: str, default: _T) -> Union[str, _T]: ...
def getheaders(self) -> List[Tuple[str, str]]: ...
def fileno(self) -> int: ...
def isclosed(self) -> bool: ...
def __iter__(self) -> Iterator[bytes]: ...
def __enter__(self) -> HTTPResponse: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[types.TracebackType]) -> bool: ...
def info(self) -> email.message.Message: ...
def geturl(self) -> str: ...
def getcode(self) -> int: ...
def begin(self) -> None: ...
else:
class HTTPResponse(io.RawIOBase, BinaryIO): # type: ignore
msg: HTTPMessage
headers: HTTPMessage
version: int
debuglevel: int
closed: bool
status: int
reason: str
def read(self, amt: Optional[int] = ...) -> bytes: ...
def readinto(self, b: bytearray) -> int: ...
@overload
def getheader(self, name: str) -> Optional[str]: ...
@overload
def getheader(self, name: str, default: _T) -> Union[str, _T]: ...
def getheaders(self) -> List[Tuple[str, str]]: ...
def fileno(self) -> int: ...
def __iter__(self) -> Iterator[bytes]: ...
def __enter__(self) -> HTTPResponse: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[types.TracebackType]) -> bool: ...
def info(self) -> email.message.Message: ...
def geturl(self) -> str: ...
def getcode(self) -> int: ...
def begin(self) -> None: ...
# Ignore errors to work around python/mypy#5027
class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore
msg: HTTPMessage
headers: HTTPMessage
version: int
debuglevel: int
closed: bool
status: int
reason: str
def __init__(self, sock: socket, debuglevel: int = ...,
method: Optional[str] = ..., url: Optional[str] = ...) -> None: ...
def read(self, amt: Optional[int] = ...) -> bytes: ...
@overload
def getheader(self, name: str) -> Optional[str]: ...
@overload
def getheader(self, name: str, default: _T) -> Union[str, _T]: ...
def getheaders(self) -> List[Tuple[str, str]]: ...
def fileno(self) -> int: ...
def isclosed(self) -> bool: ...
def __iter__(self) -> Iterator[bytes]: ...
def __enter__(self) -> HTTPResponse: ...
def __exit__(self, exc_type: Optional[Type[BaseException]],
exc_val: Optional[BaseException],
exc_tb: Optional[types.TracebackType]) -> bool: ...
def info(self) -> email.message.Message: ...
def geturl(self) -> str: ...
def getcode(self) -> int: ...
def begin(self) -> None: ...
# This is an API stub only for the class below, not a class itself.
# urllib.request uses it for a parameter.
@@ -220,5 +193,4 @@ class ResponseNotReady(ImproperConnectionState): ...
class BadStatusLine(HTTPException): ...
class LineTooLong(HTTPException): ...
if sys.version_info >= (3, 5):
class RemoteDisconnected(ConnectionResetError, BadStatusLine): ...
class RemoteDisconnected(ConnectionResetError, BadStatusLine): ...