mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
Merged fix for #13211 from 3.2
This commit is contained in:
commit
0612e8c2a2
2 changed files with 17 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue