From 5e84d12bc7588157762f6e2540b2b2a88f6338bf Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Sat, 25 Mar 2023 18:31:41 +0000 Subject: [PATCH] Use the daemon attribute instead of setDaemon setDaemon was deprecated in https://github.com/python/cpython/pull/25174 Fixes: ``` >>> test_tls_server("ECDHE-RSA-AES128-SHA", "-tls1") Traceback (most recent call last): File "", line 2, in File "", line 9, in test_tls_server File "/usr/lib64/python3.11/threading.py", line 1240, in setDaemon warnings.warn('setDaemon() is deprecated, set the daemon attribute instead', DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead ``` --- test/tls/tests_tls_netaccess.uts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/tls/tests_tls_netaccess.uts b/test/tls/tests_tls_netaccess.uts index c7c7729fda2..e44f321afe8 100644 --- a/test/tls/tests_tls_netaccess.uts +++ b/test/tls/tests_tls_netaccess.uts @@ -145,8 +145,7 @@ def test_tls_server(suite="", version="", tls13=False, client_auth=False, psk=No q_ = Queue() th_ = threading.Thread(target=run_tls_test_server, args=(msg, q_), kwargs={"curve": None, "cookie": False, "client_auth": client_auth, "psk": psk}, - name="test_tls_server %s %s" % (suite, version)) - th_.setDaemon(True) + name="test_tls_server %s %s" % (suite, version), daemon=True) th_.start() # Synchronise threads q_.get() @@ -254,8 +253,7 @@ def test_tls_client(suite, version, curve=None, cookie=False, client_auth=False, th_ = threading.Thread(target=run_tls_test_server, args=(msg, q_), kwargs={"curve": None, "cookie": False, "client_auth": client_auth, "handle_session_ticket": sess_in_out}, - name="test_tls_client %s %s" % (suite, version)) - th_.setDaemon(True) + name="test_tls_client %s %s" % (suite, version), daemon=True) th_.start() # Synchronise threads print("Syncrhonising...")