zerver/lib/timeout.py: Replace isAlive by is_alive.

In threading.Thread, isAlive has been removed in python 3.
We should use is_alive instead.
This commit is contained in:
Eklavya Sharma 2016-07-03 18:07:59 +05:30 committed by Tim Abbott
parent d8de54abe5
commit 6505cbf2bf
2 changed files with 2 additions and 3 deletions

View File

@ -51,7 +51,6 @@ zerver/lib/email_mirror.py
zerver/lib/notifications.py
zerver/lib/parallel.py
zerver/lib/test_helpers.py
zerver/lib/timeout.py
zerver/lib/tornado_ioloop_logging.py
zerver/management/commands/create_stream.py
zerver/management/commands/email-mirror.py

View File

@ -74,7 +74,7 @@ def timeout(timeout, func, *args, **kwargs):
thread.start()
thread.join(timeout)
if thread.isAlive():
if thread.is_alive():
# Gamely try to kill the thread, following the dodgy approach from
# http://stackoverflow.com/a/325528/90777
#
@ -83,7 +83,7 @@ def timeout(timeout, func, *args, **kwargs):
for i in range(10):
thread.raise_async_timeout()
time.sleep(0.1)
if not thread.isAlive():
if not thread.is_alive():
break
raise TimeoutExpired