From 5f1adbfbd2e7cc7b73ccf4ffc7900ffc801fc06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Gr=C3=BCbel?= Date: Tue, 5 Oct 2021 01:01:33 +0200 Subject: [PATCH] Add missing property in urllib.response, fix code types (#6108) --- stdlib/urllib/response.pyi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/stdlib/urllib/response.pyi b/stdlib/urllib/response.pyi index dd8a80833..647ebf874 100644 --- a/stdlib/urllib/response.pyi +++ b/stdlib/urllib/response.pyi @@ -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: ...