From: Jeremy Hylton Date: Thu, 25 Feb 1999 16:14:58 +0000 (+0000) Subject: http_error had the 'data is None' test backwards. don't call with the X-Git-Tag: v1.5.2c1~244 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b30f52a4715407d7be78569123b7379dc47299cb;p=python http_error had the 'data is None' test backwards. don't call with the extra argument if data is None. --- diff --git a/Lib/urllib.py b/Lib/urllib.py index 3c8bc0f1e8..7319bd623f 100644 --- a/Lib/urllib.py +++ b/Lib/urllib.py @@ -290,12 +290,11 @@ class URLopener: if hasattr(self, name): method = getattr(self, name) if data is None: - result = method(url, fp, errcode, errmsg, headers, data) - else: result = method(url, fp, errcode, errmsg, headers) + else: + result = method(url, fp, errcode, errmsg, headers, data) if result: return result - return self.http_error_default( - url, fp, errcode, errmsg, headers) + return self.http_error_default(url, fp, errcode, errmsg, headers) # Default http error handler: close the connection and raises IOError def http_error_default(self, url, fp, errcode, errmsg, headers):