From 407380f63f9f831e0cd445ba8527d3d195f478ed Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 6 Sep 2016 11:14:09 +0200 Subject: [PATCH] Issue 27744: skip test if AF_ALG socket bind fails --- Lib/test/test_socket.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index 71837143c5..b3632e9af9 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -5343,7 +5343,11 @@ class LinuxKernelCryptoAPI(unittest.TestCase): # tests for AF_ALG def create_alg(self, typ, name): sock = socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0) - sock.bind((typ, name)) + try: + sock.bind((typ, name)) + except FileNotFoundError as e: + # type / algorithm is not available + raise unittest.SkipTest(str(e), typ, name) return sock def test_sha256(self): -- 2.40.0