mirror of
https://github.com/python/cpython.git
synced 2025-11-07 09:02:02 +00:00
#2585: initialize code attribute of HTTPError.
This commit is contained in:
parent
8f80a6a5f9
commit
99bb5f3fef
1 changed files with 1 additions and 1 deletions
|
|
@ -159,7 +159,7 @@ def __init__(self, url, code, msg, hdrs, fp):
|
||||||
# file object. If this happens, the simplest workaround is to
|
# file object. If this happens, the simplest workaround is to
|
||||||
# not initialize the base classes.
|
# not initialize the base classes.
|
||||||
if fp is not None:
|
if fp is not None:
|
||||||
self.__super_init(fp, hdrs, url)
|
self.__super_init(fp, hdrs, url, code)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return 'HTTP Error %s: %s' % (self.code, self.msg)
|
return 'HTTP Error %s: %s' % (self.code, self.msg)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue