Kaydet (Commit) 7ff21d7a authored tarafından Jason R. Coombs's avatar Jason R. Coombs

Pass positional arguments - HTTPError is not accepting keyword arguments.…

Pass positional arguments - HTTPError is not accepting keyword arguments. Reference #13211 and #12555.
üst 090d8132
...@@ -1454,7 +1454,9 @@ def test_HTTPError_interface(): ...@@ -1454,7 +1454,9 @@ def test_HTTPError_interface():
Issue 13211 reveals that HTTPError didn't implement the URLError Issue 13211 reveals that HTTPError didn't implement the URLError
interface even though HTTPError is a subclass of URLError. interface even though HTTPError is a subclass of URLError.
>>> err = urllib.error.HTTPError(msg='something bad happened', url=None, code=None, hdrs=None, fp=None) >>> msg = 'something bad happened'
>>> url = code = hdrs = fp = None
>>> err = urllib.error.HTTPError(msg, url, code, hdrs, fp)
>>> assert hasattr(err, 'reason') >>> assert hasattr(err, 'reason')
>>> err.reason >>> err.reason
'something bad happened' 'something bad happened'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment