mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
http: update for py38 (#3606)
* http: add UNAVAILABLE_FOR_LEGAL_REASONS * http.cookiejar: filename parameter now supports path-like
This commit is contained in:
committed by
Sebastian Rittau
parent
055a907e75
commit
b8299bd58a
@@ -65,3 +65,5 @@ class HTTPStatus(IntEnum):
|
||||
NETWORK_AUTHENTICATION_REQUIRED: int
|
||||
if sys.version_info >= (3, 7):
|
||||
MISDIRECTED_REQUEST: int
|
||||
if sys.version_info >= (3, 8):
|
||||
UNAVAILABLE_FOR_LEGAL_REASONS: int
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import sys
|
||||
from typing import Dict, Iterable, Iterator, Optional, Sequence, Tuple, TypeVar, Union, overload
|
||||
from http.client import HTTPResponse
|
||||
from urllib.request import Request
|
||||
if sys.version_info >= (3, 6):
|
||||
from os import PathLike
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
@@ -27,8 +30,12 @@ class CookieJar(Iterable[Cookie]):
|
||||
class FileCookieJar(CookieJar):
|
||||
filename: str
|
||||
delayload: bool
|
||||
def __init__(self, filename: str = ..., delayload: bool = ...,
|
||||
policy: Optional[CookiePolicy] = ...) -> None: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(self, filename: Union[str, PathLike[str]] = ..., delayload: bool = ...,
|
||||
policy: Optional[CookiePolicy] = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, filename: str = ..., delayload: bool = ...,
|
||||
policy: Optional[CookiePolicy] = ...) -> None: ...
|
||||
def save(self, filename: Optional[str] = ..., ignore_discard: bool = ...,
|
||||
ignore_expires: bool = ...) -> None: ...
|
||||
def load(self, filename: Optional[str] = ..., ignore_discard: bool = ...,
|
||||
|
||||
Reference in New Issue
Block a user