Skip to content

Commit 46fc776

Browse files
authored
Add missing 'headers' property to urllib.error.HTTPError. (#7783)
Seen here: https://docs.python.org/3/library/urllib.error.html#urllib.error.HTTPError.headers
1 parent 92c5785 commit 46fc776

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/urllib/error.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ class URLError(IOError):
99
def __init__(self, reason: str | BaseException, filename: str | None = ...) -> None: ...
1010

1111
class HTTPError(URLError, addinfourl):
12+
@property
13+
def headers(self) -> Message: ... # type: ignore[override]
1214
@property
1315
def reason(self) -> str: ... # type: ignore[override]
1416
code: int

0 commit comments

Comments
 (0)