Fix Issue15701 : add .headers attribute to urllib.error.HTTPError

This commit is contained in:
Senthil Kumaran 2012-12-10 02:09:35 -08:00
parent 8e5a8296cc
commit 5962cce050
4 changed files with 23 additions and 1 deletions

View file

@ -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):