diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2013-11-22 17:05:06 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2013-11-22 17:05:06 (GMT) |
commit | 330ce596c25abf4497f721c9382e36b2b79e8bfe (patch) | |
tree | 2b129e40a692dfa1c6a090fec6b60b731483060e /Lib/test/test_pathlib.py | |
parent | fddc311fe84f6d0a51971c080a5b1089d99c31e6 (diff) | |
download | cpython-330ce596c25abf4497f721c9382e36b2b79e8bfe.zip cpython-330ce596c25abf4497f721c9382e36b2b79e8bfe.tar.gz cpython-330ce596c25abf4497f721c9382e36b2b79e8bfe.tar.bz2 |
Hopefully fix test_is_socket_true
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rwxr-xr-x | Lib/test/test_pathlib.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 7ece1f5..e23e5a7 100755 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -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()) |