Skip to content

Commit

Permalink
Python 3.8 removed importlib-metadata. isAlive was refactored into is…
Browse files Browse the repository at this point in the history
…_alive
  • Loading branch information
Psychokiller1888 committed Dec 14, 2023
1 parent f954383 commit 63ddcec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
8 changes: 4 additions & 4 deletions core/util/ThreadManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ def __init__(self):
def onStop(self):
super().onStop()
for timer in self._timers:
if timer.timer.isAlive():
if timer.timer.is_alive():
timer.timer.cancel()

for thread in self._threads.values():
if thread.isAlive():
if thread.is_alive():
thread.join(timeout=1)

for event in self._events.values():
Expand All @@ -69,7 +69,7 @@ def onQuarterHour(self):
deadThreads = 0
timers = self._timers.copy()
for threadTimer in timers:
if not threadTimer.timer.isAlive():
if not threadTimer.timer.is_alive():
self._timers.remove(threadTimer)
deadTimers += 1

Expand Down Expand Up @@ -166,7 +166,7 @@ def isThreadAlive(self, name: str) -> bool:
if name not in self._threads:
return any(t.name == name and t.is_alive() for t in threading.enumerate())

return self._threads[name].isAlive()
return self._threads[name].is_alive()


def newEvent(self, name: str, onSetCallback: Union[str, Callable] = None, onClearCallback: Union[str, Callable] = None) -> AliceEvent:
Expand Down
2 changes: 1 addition & 1 deletion core/voice/WakewordRecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def onStop(self):
super().onStop()

for thread in self._wakewordUploadThreads:
if thread.isAlive():
if thread.is_alive():
thread.join(timeout=2)


Expand Down
5 changes: 3 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#numpy==1.21.6
numpy~=1.26
importlib-metadata~=7.0
pyopenssl>22.1.0
paho-mqtt~=1.6.1
googletrans~=3.0.0
Expand All @@ -21,9 +23,8 @@ jsmin~=3.0.1
psutil~=5.9.0
pyserial~=3.5
pyyaml~=6.0
scipy~=1.7.3
scipy~=1.11
webrtcvad~=2.0.10
Werkzeug~=2.1.1
Jinja2~=3.1.1
numpy~=1.26
projectalice-sk

0 comments on commit 63ddcec

Please sign in to comment.