trx_toolkit/clck_gen: Fix DeprecationWarning about Thread.setDaemon
commit008dfba7d8511912e7a1dbc3a32d89bfee007b16
authorKirill Smelkov <kirr@nexedi.com>
Wed, 15 Jan 2025 16:01:31 +0000 (15 19:01 +0300)
committerKirill Smelkov <kirr@nexedi.com>
Wed, 15 Jan 2025 16:01:31 +0000 (15 19:01 +0300)
tree241034a40f06f7bc166d065ed17eb9da106416f5
parentabc63d8d825eb56fdcd7e01bf8824915c8780e18
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
src/target/trx_toolkit/clck_gen.py