From e88ed05006d4eef73e550149efa5ec11c6336dcc Mon Sep 17 00:00:00 2001 From: Xavier de Gaye Date: Wed, 14 Dec 2016 11:52:28 +0100 Subject: Issue #28683: Fix the tests that bind() a unix socket and raise PermissionError on Android for a non-root user. --- Lib/test/test_pathlib.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Lib/test/test_pathlib.py') diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py index 65b2d5abda..ce1ca153ed 100644 --- a/Lib/test/test_pathlib.py +++ b/Lib/test/test_pathlib.py @@ -1888,7 +1888,8 @@ class _BasePathTest(object): try: sock.bind(str(P)) except OSError as e: - if "AF_UNIX path too long" in str(e): + if (isinstance(e, PermissionError) or + "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()) -- cgit v1.2.1