#2585: initialize code attribute of HTTPError.

This commit is contained in:
Georg Brandl 2008-04-09 17:57:38 +00:00
parent 8f80a6a5f9
commit 99bb5f3fef
1 changed files with 1 additions and 1 deletions

View File

@ -159,7 +159,7 @@ class HTTPError(URLError, addinfourl):
# file object. If this happens, the simplest workaround is to
# not initialize the base classes.
if fp is not None:
self.__super_init(fp, hdrs, url)
self.__super_init(fp, hdrs, url, code)
def __str__(self):
return 'HTTP Error %s: %s' % (self.code, self.msg)