Merged fix for #13211 from 3.2

This commit is contained in:
Jason R. Coombs 2011-12-03 09:39:58 -05:00
commit 0612e8c2a2
2 changed files with 17 additions and 0 deletions

View file

@ -55,6 +55,12 @@ class HTTPError(URLError, urllib.response.addinfourl):
def __str__(self):
return 'HTTP Error %s: %s' % (self.code, self.msg)
# since URLError specifies a .reason attribute, HTTPError should also
# provide this attribute. See issue13211 for discussion.
@property
def reason(self):
return self.msg
# exception raised when downloaded size does not match content-length
class ContentTooShortError(URLError):
def __init__(self, message, content):