mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #16717: get rid of socket.error, replace with OSError
This commit is contained in:
parent
ad28c7f9da
commit
0832af6628
39 changed files with 169 additions and 167 deletions
|
@ -344,7 +344,7 @@ class MockHTTPClass:
|
|||
self.data = body
|
||||
if self.raise_on_endheaders:
|
||||
import socket
|
||||
raise socket.error()
|
||||
raise OSError()
|
||||
def getresponse(self):
|
||||
return MockHTTPResponse(MockFile(), {}, 200, "OK")
|
||||
|
||||
|
@ -845,7 +845,7 @@ class HandlerTests(unittest.TestCase):
|
|||
("Foo", "bar"), ("Spam", "eggs")])
|
||||
self.assertEqual(http.data, data)
|
||||
|
||||
# check socket.error converted to URLError
|
||||
# check OSError converted to URLError
|
||||
http.raise_on_endheaders = True
|
||||
self.assertRaises(urllib.error.URLError, h.do_open, http, req)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue