mirror of https://github.com/zulip/zulip.git
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:
parent
d8de54abe5
commit
6505cbf2bf
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue