summaryrefslogtreecommitdiff
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 815f9adce6..0094cecb79 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1796,8 +1796,13 @@ class GeneralModuleTests(unittest.TestCase):
self.addCleanup(shutil.rmtree, tmpdir)
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.addCleanup(s.close)
- s.bind(os.path.join(tmpdir, 'socket'))
- self._test_socket_fileno(s, socket.AF_UNIX, socket.SOCK_STREAM)
+ try:
+ s.bind(os.path.join(tmpdir, 'socket'))
+ except PermissionError:
+ pass
+ else:
+ self._test_socket_fileno(s, socket.AF_UNIX,
+ socket.SOCK_STREAM)
def test_socket_fileno_rejects_float(self):
with self.assertRaisesRegex(TypeError, "integer argument expected"):