From 99bb5f3fef86bae6512e2bf18f85a42f05cf0e09 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 9 Apr 2008 17:57:38 +0000 Subject: #2585: initialize code attribute of HTTPError. --- Lib/urllib2.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/urllib2.py b/Lib/urllib2.py index 437a813..a20e552 100644 --- a/Lib/urllib2.py +++ b/Lib/urllib2.py @@ -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) -- cgit v0.12