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

@ -95,7 +95,9 @@ def bind_af_aware(sock, addr):
if HAS_UNIX_SOCKETS and sock.family == socket.AF_UNIX:
# Make sure the path doesn't exist.
support.unlink(addr)
sock.bind(addr)
support.bind_unix_socket(sock, addr)
else:
sock.bind(addr)
class HelperFunctionTests(unittest.TestCase):