From a9558231cf8cdf5826829bc77a93b914b0d1fd79 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 30 Mar 2023 14:55:36 +0200 Subject: [PATCH] client/tests: drop unnecessary socket.set_inheritable() call from "test-client.py" This seems unnecessary, because we spawn the child process via subprocess.Popen and set "pass_fds". That already ensures to pass on the FD. Worse, socket.set_inheritable() is only added in Python 3.4, that means the test is gonna break for Python 3.2 and 3.3. Just avoid that by not using the unnecessary function. For the same reason, drop "inheritable=True" from os.dup2(). "inheritable=True" is already the default, but only exists since Python 3.4. Fixes: d89d42bf2317 ('tests/client: test nm-cloud-setup') --- src/tests/client/test-client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/client/test-client.py b/src/tests/client/test-client.py index 31cfbb0e1e..84450e2ad3 100755 --- a/src/tests/client/test-client.py +++ b/src/tests/client/test-client.py @@ -2151,7 +2151,6 @@ class TestNmCloudSetup(TestNmClient): raise unittest.SkipTest("This test requires at least Python 3.2") s = socket.socket() - s.set_inheritable(True) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) s.bind(("localhost", 0)) @@ -2162,7 +2161,7 @@ class TestNmCloudSetup(TestNmClient): s.listen(5) def pass_socket(): - os.dup2(s.fileno(), 3, inheritable=True) + os.dup2(s.fileno(), 3) service_path = PathConfiguration.test_cloud_meta_mock_path() env = os.environ.copy()