mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 13:32:26 +08:00
Drop Python 3.3 support from several stubs (#2265)
* Drop Python 3.3 support from several stubs * Revert wrong socketserver changes
This commit is contained in:
committed by
Jelle Zijlstra
parent
b05e99297c
commit
95eff73ab2
@@ -114,8 +114,7 @@ else:
|
||||
status = ... # type: int
|
||||
reason = ... # type: str
|
||||
def read(self, amt: Optional[int] = ...) -> bytes: ...
|
||||
if sys.version_info >= (3, 3):
|
||||
def readinto(self, b: bytearray) -> int: ...
|
||||
def readinto(self, b: bytearray) -> int: ...
|
||||
@overload
|
||||
def getheader(self, name: str) -> Optional[str]: ...
|
||||
@overload
|
||||
@@ -136,20 +135,13 @@ class HTTPConnection:
|
||||
timeout: int = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ..., blocksize: int = ...
|
||||
) -> None: ...
|
||||
elif sys.version_info >= (3, 4):
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
host: str, port: Optional[int] = ...,
|
||||
timeout: int = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
self,
|
||||
host: str, port: Optional[int] = ...,
|
||||
strict: bool = ..., timeout: int = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...
|
||||
)-> None: ...
|
||||
def request(self, method: str, url: str,
|
||||
body: Optional[_DataType] = ...,
|
||||
headers: Mapping[str, str] = ...) -> None: ...
|
||||
@@ -166,24 +158,14 @@ class HTTPConnection:
|
||||
def send(self, data: _DataType) -> None: ...
|
||||
|
||||
class HTTPSConnection(HTTPConnection):
|
||||
if sys.version_info >= (3, 4):
|
||||
def __init__(self,
|
||||
host: str, port: Optional[int] = ...,
|
||||
key_file: Optional[str] = ...,
|
||||
cert_file: Optional[str] = ...,
|
||||
timeout: int = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...,
|
||||
*, context: Optional[ssl.SSLContext] = ...,
|
||||
check_hostname: Optional[bool] = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self,
|
||||
host: str, port: Optional[int] = ...,
|
||||
key_file: Optional[str] = ...,
|
||||
cert_file: Optional[str] = ...,
|
||||
strict: bool = ..., timeout: int = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...,
|
||||
*, context: Optional[ssl.SSLContext] = ...,
|
||||
check_hostname: Optional[bool] = ...) -> None: ...
|
||||
def __init__(self,
|
||||
host: str, port: Optional[int] = ...,
|
||||
key_file: Optional[str] = ...,
|
||||
cert_file: Optional[str] = ...,
|
||||
timeout: int = ...,
|
||||
source_address: Optional[Tuple[str, int]] = ...,
|
||||
*, context: Optional[ssl.SSLContext] = ...,
|
||||
check_hostname: Optional[bool] = ...) -> None: ...
|
||||
|
||||
class HTTPException(Exception): ...
|
||||
error = HTTPException
|
||||
|
||||
@@ -1,14 +1,10 @@
|
||||
from typing import Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload
|
||||
from http.client import HTTPResponse
|
||||
import sys
|
||||
from urllib.request import Request
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
class LoadError(OSError): ...
|
||||
else:
|
||||
class LoadError(IOError): ...
|
||||
class LoadError(OSError): ...
|
||||
|
||||
|
||||
class CookieJar(Iterable['Cookie']):
|
||||
|
||||
Reference in New Issue
Block a user