kirr has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39344?usp=email )
Change subject: trx_toolkit/clck_gen: Fix DeprecationWarning about Thread.setDaemon ......................................................................
trx_toolkit/clck_gen: Fix DeprecationWarning about Thread.setDaemon
This warning is currently emitted each time trx_toolkit unittests are run:
(osmo.venv) kirr@deca:~/src/osmocom/bb/src/target/trx_toolkit$ python -m unittest discover /home/kirr/src/osmocom/bb/src/target/trx_toolkit/clck_gen.py:71: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead self._thread.setDaemon(True) ............................................... ---------------------------------------------------------------------- Ran 47 tests in 0.997s
OK
-> Fix it by using Thread.daemon attribute directly as suggested by https://docs.python.org/3/library/threading.html#threading.Thread.setDaemon
Change-Id: I6ef70762f671b86342daa35a097532f0b620aaca --- M src/target/trx_toolkit/clck_gen.py 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/44/39344/1
diff --git a/src/target/trx_toolkit/clck_gen.py b/src/target/trx_toolkit/clck_gen.py index 15b653f..bf56f64 100755 --- a/src/target/trx_toolkit/clck_gen.py +++ b/src/target/trx_toolkit/clck_gen.py @@ -68,7 +68,7 @@
# Initialize and start a new thread self._thread = threading.Thread(target = self._worker) - self._thread.setDaemon(True) + self._thread.daemon = True self._thread.start()
def stop(self):