summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pathlib.py
diff options
context:
space:
mode:
authorXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-14 10:52:28 (GMT)
committerXavier de Gaye <xdegaye@users.sourceforge.net>2016-12-14 10:52:28 (GMT)
commite88ed05006d4eef73e550149efa5ec11c6336dcc (patch)
treefcc6a625175d8475fb86f7852da849d88070c3a1 /Lib/test/test_pathlib.py
parent1351c31aa9651b278d7ef8ec79af3b646a520235 (diff)
downloadcpython-e88ed05006d4eef73e550149efa5ec11c6336dcc.zip
cpython-e88ed05006d4eef73e550149efa5ec11c6336dcc.tar.gz
cpython-e88ed05006d4eef73e550149efa5ec11c6336dcc.tar.bz2
Issue #28683: Fix the tests that bind() a unix socket and raise PermissionError
on Android for a non-root user.
Diffstat (limited to 'Lib/test/test_pathlib.py')
-rw-r--r--Lib/test/test_pathlib.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_pathlib.py b/Lib/test/test_pathlib.py
index 65b2d5a..ce1ca15 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())