summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 21:10:48 (GMT)
committerAndrew Svetlov <andrew.svetlov@gmail.com>2012-12-18 21:10:48 (GMT)
commit0832af6628ca5ac02d0226899725297dd508470b (patch)
treefc4e7d05d9c6f51eb97f3e8abbcab2b226330b94 /Lib/test/test_asyncore.py
parentad28c7f9dad791567afa0624acfb3ba430851965 (diff)
downloadcpython-0832af6628ca5ac02d0226899725297dd508470b.zip
cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.gz
cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.bz2
Issue #16717: get rid of socket.error, replace with OSError
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r--Lib/test/test_asyncore.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 42a2525..bdb3dc0 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -756,7 +756,7 @@ class BaseTestAPI(unittest.TestCase):
s2 = asyncore.dispatcher()
s2.create_socket(self.family)
# EADDRINUSE indicates the socket was correctly bound
- self.assertRaises(socket.error, s2.bind, (self.addr[0], port))
+ self.assertRaises(OSError, s2.bind, (self.addr[0], port))
def test_set_reuse_addr(self):
if HAS_UNIX_SOCKETS and self.family == socket.AF_UNIX:
@@ -764,7 +764,7 @@ class BaseTestAPI(unittest.TestCase):
sock = socket.socket(self.family)
try:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- except socket.error:
+ except OSError:
unittest.skip("SO_REUSEADDR not supported on this platform")
else:
# if SO_REUSEADDR succeeded for sock we expect asyncore
@@ -797,7 +797,7 @@ class BaseTestAPI(unittest.TestCase):
struct.pack('ii', 1, 0))
try:
s.connect(server.address)
- except socket.error:
+ except OSError:
pass
finally:
s.close()