diff options
author | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-12-14 10:52:28 (GMT) |
---|---|---|
committer | Xavier de Gaye <xdegaye@users.sourceforge.net> | 2016-12-14 10:52:28 (GMT) |
commit | e88ed05006d4eef73e550149efa5ec11c6336dcc (patch) | |
tree | fcc6a625175d8475fb86f7852da849d88070c3a1 /Lib/test/test_pathlib.py | |
parent | 1351c31aa9651b278d7ef8ec79af3b646a520235 (diff) | |
download | cpython-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.py | 3 |
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()) |