diff options
author | Senthil Kumaran <senthil@uthcode.com> | 2012-12-10 10:09:35 (GMT) |
---|---|---|
committer | Senthil Kumaran <senthil@uthcode.com> | 2012-12-10 10:09:35 (GMT) |
commit | 5962cce05065c7d98a42f50b07c0d58c1c61790f (patch) | |
tree | 67b5dcc6d3ac29eafb28519a0c6ab299cd9272ff /Lib/urllib/error.py | |
parent | 8e5a8296cc18d4f496549551bbf21d60ba535622 (diff) | |
download | cpython-5962cce05065c7d98a42f50b07c0d58c1c61790f.zip cpython-5962cce05065c7d98a42f50b07c0d58c1c61790f.tar.gz cpython-5962cce05065c7d98a42f50b07c0d58c1c61790f.tar.bz2 |
Fix Issue15701 : add .headers attribute to urllib.error.HTTPError
Diffstat (limited to 'Lib/urllib/error.py')
-rw-r--r-- | Lib/urllib/error.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/urllib/error.py b/Lib/urllib/error.py index c1dfc40..237ed6b 100644 --- a/Lib/urllib/error.py +++ b/Lib/urllib/error.py @@ -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): |