mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
Fix Issue15701 : add .headers attribute to urllib.error.HTTPError
This commit is contained in:
parent
8e5a8296cc
commit
5962cce050
4 changed files with 23 additions and 1 deletions
|
@ -61,6 +61,14 @@ class HTTPError(URLError, urllib.response.addinfourl):
|
|||
def reason(self):
|
||||
return self.msg
|
||||
|
||||
@property
|
||||
def headers(self):
|
||||
return self.hdrs
|
||||
|
||||
@headers.setter
|
||||
def headers(self, headers):
|
||||
self.hdrs = headers
|
||||
|
||||
# exception raised when downloaded size does not match content-length
|
||||
class ContentTooShortError(URLError):
|
||||
def __init__(self, message, content):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue