mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Hopefully fix test_is_socket_true
This commit is contained in:
parent
fddc311fe8
commit
330ce596c2
1 changed files with 6 additions and 2 deletions
|
@ -1499,9 +1499,13 @@ class _BasePathTest(object):
|
|||
@unittest.skipUnless(hasattr(socket, "AF_UNIX"), "Unix sockets required")
|
||||
def test_is_socket_true(self):
|
||||
P = self.cls(BASE, 'mysock')
|
||||
sock = socket.socket(socket.SOCK_STREAM, socket.AF_UNIX)
|
||||
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||
self.addCleanup(sock.close)
|
||||
sock.bind(str(P))
|
||||
try:
|
||||
sock.bind(str(P))
|
||||
except OSError as e:
|
||||
if "AF_UNIX path too long" in str(e):
|
||||
self.skipTest("cannot bind Unix socket: " + str(e))
|
||||
self.assertTrue(P.is_socket())
|
||||
self.assertFalse(P.is_fifo())
|
||||
self.assertFalse(P.is_file())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue