mirror of
https://github.com/python/cpython.git
synced 2025-11-02 19:12:55 +00:00
http_error had the 'data is None' test backwards. don't call with the
extra argument if data is None.
This commit is contained in:
parent
f90b002e31
commit
b30f52a471
1 changed files with 3 additions and 4 deletions
|
|
@ -290,12 +290,11 @@ class URLopener:
|
||||||
if hasattr(self, name):
|
if hasattr(self, name):
|
||||||
method = getattr(self, name)
|
method = getattr(self, name)
|
||||||
if data is None:
|
if data is None:
|
||||||
result = method(url, fp, errcode, errmsg, headers, data)
|
|
||||||
else:
|
|
||||||
result = method(url, fp, errcode, errmsg, headers)
|
result = method(url, fp, errcode, errmsg, headers)
|
||||||
|
else:
|
||||||
|
result = method(url, fp, errcode, errmsg, headers, data)
|
||||||
if result: return result
|
if result: return result
|
||||||
return self.http_error_default(
|
return self.http_error_default(url, fp, errcode, errmsg, headers)
|
||||||
url, fp, errcode, errmsg, headers)
|
|
||||||
|
|
||||||
# Default http error handler: close the connection and raises IOError
|
# Default http error handler: close the connection and raises IOError
|
||||||
def http_error_default(self, url, fp, errcode, errmsg, headers):
|
def http_error_default(self, url, fp, errcode, errmsg, headers):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue