endtime += 60
for t in started:
t.join(max(endtime - time.monotonic(), 0.01))
- started = [t for t in started if t.isAlive()]
+ started = [t for t in started if t.is_alive()]
if not started:
break
if verbose:
print('Unable to join %d threads during a period of '
'%d minutes' % (len(started), timeout))
finally:
- started = [t for t in started if t.isAlive()]
+ started = [t for t in started if t.is_alive()]
if started:
faulthandler.dump_traceback(sys.stdout)
raise AssertionError('Unable to join %d threads' % len(started))
When the timeout argument is present and not None, it should be a
floating point number specifying a timeout for the operation in seconds
(or fractions thereof). As join() always returns None, you must call
- isAlive() after join() to decide whether a timeout happened -- if the
+ is_alive() after join() to decide whether a timeout happened -- if the
thread is still alive, the join() call timed out.
When the timeout argument is not present or None, the operation will
self._wait_for_tstate_lock(False)
return not self._is_stopped
- isAlive = is_alive
+ def isAlive(self):
+ """Return whether the thread is alive.
+
+ This method is deprecated, use is_alive() instead.
+ """
+ import warnings
+ warnings.warn('isAlive() is deprecated, use is_alive() instead',
+ PendingDeprecationWarning, stacklevel=2)
+ return self.is_alive()
@property
def daemon(self):