mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Pass positional arguments - HTTPError is not accepting keyword arguments. Reference #13211 and #12555.
This commit is contained in:
parent
090d8132b5
commit
7ff21d7a3c
1 changed files with 3 additions and 1 deletions
|
@ -1454,7 +1454,9 @@ def test_HTTPError_interface():
|
|||
Issue 13211 reveals that HTTPError didn't implement the 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')
|
||||
>>> err.reason
|
||||
'something bad happened'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue