torproject / stem

Python controller library for Tor
https://stem.torproject.org/
GNU Lesser General Public License v3.0
257 stars 75 forks source link

Use daemon attribute instead of deprecated setDaemon #117

Closed KnockKnockWho closed 2 years ago

KnockKnockWho commented 2 years ago

Stem uses setDaemon, which causes warnings like the following:

/usr/lib/python3.10/site-packages/stem-1.8.0-py3.10.egg/stem/control.py:934: DeprecationWarning: setDaemon() is deprecated, set the daemon attribute instead
  self._event_thread.setDaemon(True)

Therefore, I have replaced it with the daemon attribute, which is available since Python 2.6 (https://docs.python.org/2.7/library/threading.html#threading.Thread.daemon) and has been deprecated since Python 3.10 (https://docs.python.org/3.10/library/threading.html#threading.Thread.setDaemon).

atagar commented 2 years ago

Hi KnockKnock. Sorry for the long delay. This is a great patch! Thanks, merged it.