Remove Python 3.6 branches from typeshed (#8269)

This commit is contained in:
Alex Waygood
2022-07-11 09:55:17 +01:00
committed by GitHub
parent 29c17ffb47
commit edc0ecd857
114 changed files with 1016 additions and 2642 deletions

View File

@@ -1,7 +1,6 @@
import email.message
import io
import ssl
import sys
import types
from _typeshed import Self, WriteableBuffer
from collections.abc import Callable, Iterable, Iterator, Mapping
@@ -141,19 +140,14 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
# This is an API stub only for the class below, not a class itself.
# urllib.request uses it for a parameter.
class _HTTPConnectionProtocol(Protocol):
if sys.version_info >= (3, 7):
def __call__(
self,
host: str,
port: int | None = ...,
timeout: float = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> HTTPConnection: ...
else:
def __call__(
self, host: str, port: int | None = ..., timeout: float = ..., source_address: tuple[str, int] | None = ...
) -> HTTPConnection: ...
def __call__(
self,
host: str,
port: int | None = ...,
timeout: float = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> HTTPConnection: ...
class HTTPConnection:
auto_open: int # undocumented
@@ -164,20 +158,14 @@ class HTTPConnection:
host: str
port: int
sock: Any
if sys.version_info >= (3, 7):
def __init__(
self,
host: str,
port: int | None = ...,
timeout: float | None = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> None: ...
else:
def __init__(
self, host: str, port: int | None = ..., timeout: float | None = ..., source_address: tuple[str, int] | None = ...
) -> None: ...
def __init__(
self,
host: str,
port: int | None = ...,
timeout: float | None = ...,
source_address: tuple[str, int] | None = ...,
blocksize: int = ...,
) -> None: ...
def request(
self, method: str, url: str, body: _DataType | None = ..., headers: Mapping[str, str] = ..., *, encode_chunked: bool = ...
) -> None: ...
@@ -192,33 +180,19 @@ class HTTPConnection:
def send(self, data: _DataType) -> None: ...
class HTTPSConnection(HTTPConnection):
if sys.version_info >= (3, 7):
def __init__(
self,
host: str,
port: int | None = ...,
key_file: str | None = ...,
cert_file: str | None = ...,
timeout: float | None = ...,
source_address: tuple[str, int] | None = ...,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,
blocksize: int = ...,
) -> None: ...
else:
def __init__(
self,
host: str,
port: int | None = ...,
key_file: str | None = ...,
cert_file: str | None = ...,
timeout: float | None = ...,
source_address: tuple[str, int] | None = ...,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,
) -> None: ...
def __init__(
self,
host: str,
port: int | None = ...,
key_file: str | None = ...,
cert_file: str | None = ...,
timeout: float | None = ...,
source_address: tuple[str, int] | None = ...,
*,
context: ssl.SSLContext | None = ...,
check_hostname: bool | None = ...,
blocksize: int = ...,
) -> None: ...
class HTTPException(Exception): ...