Skip to content

Commit

Permalink
bitbake: bitbake: fix deprecated threading.Thread.setDaemon
Browse files Browse the repository at this point in the history
Deprecated in Python 3.10:
https://docs.python.org/3/whatsnew/3.10.html#deprecated
python/cpython#25174

Fixes warnings like:

...bitbake/lib/bb/ui/uievent.py:68: DeprecationWarning: setDaemon() is
deprecated, set the daemon attribute instead
  self.t.setDaemon(True)

(Bitbake rev: ea88be5cb39af86a5bc8a7d151ba65bd12df681f)

Signed-off-by: Tim Orling <[email protected]>
Signed-off-by: Richard Purdie <[email protected]>
  • Loading branch information
moto-timo authored and rpurdie committed Jan 23, 2023
1 parent 3f53768 commit 2e30849
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bitbake/lib/bb/ui/taskexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class gtkthread(threading.Thread):
quit = threading.Event()
def __init__(self, shutdown):
threading.Thread.__init__(self)
self.setDaemon(True)
self.daemon = True
self.shutdown = shutdown
if not Gtk.init_check()[0]:
sys.stderr.write("Gtk+ init failed. Make sure DISPLAY variable is set.\n")
Expand Down
2 changes: 1 addition & 1 deletion bitbake/lib/bb/ui/uievent.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, BBServer, clientinfo=("localhost, 0")):
self.server = server

self.t = threading.Thread()
self.t.setDaemon(True)
self.t.daemon = True
self.t.run = self.startCallbackHandler
self.t.start()

Expand Down
2 changes: 1 addition & 1 deletion bitbake/lib/toaster/orm/management/commands/lsupdates.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Spinner(threading.Thread):
""" A simple progress spinner to indicate download/parsing is happening"""
def __init__(self, *args, **kwargs):
super(Spinner, self).__init__(*args, **kwargs)
self.setDaemon(True)
self.daemon = True
self.signal = True

def run(self):
Expand Down
2 changes: 1 addition & 1 deletion bitbake/lib/toaster/tests/commands/test_runbuilds.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class KillRunbuilds(threading.Thread):
""" Kill the runbuilds process after an amount of time """
def __init__(self, *args, **kwargs):
super(KillRunbuilds, self).__init__(*args, **kwargs)
self.setDaemon(True)
self.daemon = True

def run(self):
time.sleep(5)
Expand Down

0 comments on commit 2e30849

Please sign in to comment.