Add missing property in urllib.response, fix code types (#6108)

This commit is contained in:
Anton Grübel
2021-10-05 01:01:33 +02:00
committed by GitHub
parent 9b86402c77
commit 5f1adbfbd2

View File

@@ -1,3 +1,4 @@
import sys
from _typeshed import Self
from email.message import Message
from types import TracebackType
@@ -46,7 +47,10 @@ class addinfo(addbase):
class addinfourl(addinfo):
url: str
code: int
code: int | None
if sys.version_info >= (3, 9):
@property
def status(self) -> int | None: ...
def __init__(self, fp: IO[bytes], headers: Message, url: str, code: int | None = ...) -> None: ...
def geturl(self) -> str: ...
def getcode(self) -> int: ...
def getcode(self) -> int | None: ...