summaryrefslogtreecommitdiffstats
path: root/Lib/urllib.py
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>1999-02-25 16:14:58 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>1999-02-25 16:14:58 (GMT)
commitb30f52a4715407d7be78569123b7379dc47299cb (patch)
tree69a0be7739b9ed6cc88fe034f61b3acd9421bf7a /Lib/urllib.py
parentf90b002e31f245286e34209a96e13d1d5e281c76 (diff)
downloadcpython-b30f52a4715407d7be78569123b7379dc47299cb.zip
cpython-b30f52a4715407d7be78569123b7379dc47299cb.tar.gz
cpython-b30f52a4715407d7be78569123b7379dc47299cb.tar.bz2
http_error had the 'data is None' test backwards. don't call with the
extra argument if data is None.
Diffstat (limited to 'Lib/urllib.py')
-rw-r--r--Lib/urllib.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/urllib.py b/Lib/urllib.py
index 3c8bc0f..7319bd6 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):