Issue #28683: Fix the tests that bind() a unix socket and raise PermissionError

on Android for a non-root user.
This commit is contained in:
Xavier de Gaye 2016-12-14 11:52:28 +01:00
parent 1351c31aa9
commit e88ed05006
5 changed files with 33 additions and 8 deletions

View file

@ -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())