mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
open_http also had the 'data is None' test backwards. don't call with the
extra argument if data is None.
This commit is contained in:
parent
dc12ec8ca0
commit
29aab7582f
1 changed files with 2 additions and 3 deletions
|
@ -276,10 +276,9 @@ class URLopener:
|
||||||
return addinfourl(fp, headers, "http:" + url)
|
return addinfourl(fp, headers, "http:" + url)
|
||||||
else:
|
else:
|
||||||
if data is None:
|
if data is None:
|
||||||
return self.http_error(url, fp, errcode, errmsg,
|
|
||||||
headers, data)
|
|
||||||
else:
|
|
||||||
return self.http_error(url, fp, errcode, errmsg, headers)
|
return self.http_error(url, fp, errcode, errmsg, headers)
|
||||||
|
else:
|
||||||
|
return self.http_error(url, fp, errcode, errmsg, headers, data)
|
||||||
|
|
||||||
# Handle http errors.
|
# Handle http errors.
|
||||||
# Derived class can override this, or provide specific handlers
|
# Derived class can override this, or provide specific handlers
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue