From 5ededca7dbbc6a56d9a7233166efee3b3f8fe5fb Mon Sep 17 00:00:00 2001 From: Grant Meyerhoff Date: Fri, 3 Jan 2025 14:48:10 -0600 Subject: [PATCH] host: remove deprecated setName usage As of Python3.10, setName has been deprecated in favor of using name directly as a property --- host/examples/python/benchmark_rate.py | 6 +++--- host/python/uhd/usrp/cal/tone_gen.py | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/host/examples/python/benchmark_rate.py b/host/examples/python/benchmark_rate.py index 805adb039..88741b16f 100755 --- a/host/examples/python/benchmark_rate.py +++ b/host/examples/python/benchmark_rate.py @@ -468,10 +468,10 @@ def main(): rx_thread = threading.Thread( target=benchmark_rx_rate, args=(usrp, rx_streamer, args.random, quit_event, rx_statistics), + name="bmark_rx_stream", ) threads.append(rx_thread) rx_thread.start() - rx_thread.setName("bmark_rx_stream") # Create a dictionary for the RX statistics # Note: we're going to use this without locks, so don't access it from the main thread until @@ -488,18 +488,18 @@ def main(): tx_thread = threading.Thread( target=benchmark_tx_rate, args=(usrp, tx_streamer, args.random, quit_event, tx_statistics), + name="bmark_tx_stream", ) threads.append(tx_thread) tx_thread.start() - tx_thread.setName("bmark_tx_stream") tx_async_thread = threading.Thread( target=benchmark_tx_rate_async_helper, args=(tx_streamer, quit_event, tx_async_statistics), + name="bmark_tx_helper", ) threads.append(tx_async_thread) tx_async_thread.start() - tx_async_thread.setName("bmark_tx_helper") # Sleep for the required duration # If we have a multichannel test, add some time for initialization diff --git a/host/python/uhd/usrp/cal/tone_gen.py b/host/python/uhd/usrp/cal/tone_gen.py index 93d0e40ca..53268eaa7 100644 --- a/host/python/uhd/usrp/cal/tone_gen.py +++ b/host/python/uhd/usrp/cal/tone_gen.py @@ -32,9 +32,8 @@ class WaveformGenerator: if not self._streamer: raise RuntimeError("No streamer defined!") self._run = True - self._thread = threading.Thread(target=self._worker) + self._thread = threading.Thread(target=self._worker, name="cal_tx") self._thread.start() - self._thread.setName("cal_tx") def stop(self): """Stop the transmitter."""