Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7ff21d7

Browse files
committed
Pass positional arguments - HTTPError is not accepting keyword arguments. Reference #13211 and #12555.
1 parent 090d813 commit 7ff21d7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/test/test_urllib2.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,9 @@ def test_HTTPError_interface():
14541454
Issue 13211 reveals that HTTPError didn't implement the URLError
14551455
interface even though HTTPError is a subclass of URLError.
14561456
1457-
>>> err = urllib.error.HTTPError(msg='something bad happened', url=None, code=None, hdrs=None, fp=None)
1457+
>>> msg = 'something bad happened'
1458+
>>> url = code = hdrs = fp = None
1459+
>>> err = urllib.error.HTTPError(msg, url, code, hdrs, fp)
14581460
>>> assert hasattr(err, 'reason')
14591461
>>> err.reason
14601462
'something bad happened'

0 commit comments

Comments
 (0)