We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e33989d + 953aa85 commit fd1c8d1Copy full SHA for fd1c8d1
1 file changed
library/cap1xxx.py
@@ -205,13 +205,20 @@ def __init__(self):
205
self.stop_event = threading.Event()
206
self.daemon = True
207
208
+ def alive(self):
209
+ try:
210
+ return self.isAlive()
211
+ except AttributeError:
212
+ # Python >= 3.9
213
+ return self.is_alive()
214
+
215
def start(self):
- if self.isAlive() == False:
216
+ if self.alive() == False:
217
self.stop_event.clear()
218
threading.Thread.start(self)
219
220
def stop(self):
- if self.isAlive() == True:
221
+ if self.alive() == True:
222
# set event to signal thread to terminate
223
self.stop_event.set()
224
# block calling thread until thread really has terminated
0 commit comments