Skip to content

Commit

Permalink
Fix: Compatibility issue with python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed Dec 31, 2022
1 parent 22c30ff commit 9c94f97
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions modules/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,20 @@ def cancel_all(self):
pass

def busy(self):
result = False
with self._block:
result = self.active_task is not None
return result
return self.active_task is not None

def run(self):
self.running = True
while self.running:
task = self.queue.get()
with self._block:
self.active_task = task
self.active_task = task
try:
task.run()
except:
traceback.print_exc()
finally:
self.queue.task_done()
with self._block:
self.active_task = None
self.active_task = None


_tasks = TaskQueue()
Expand Down

0 comments on commit 9c94f97

Please sign in to comment.