From 482f0833884fe490d50eb03a08eebfb19e9ed46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sat, 4 Jan 2020 23:59:54 +0100 Subject: Python 3.9 compatibility Thread.isAlive() is deprecated in 3.8 and removed in 3.9: $ python3.8 -c 'import threading; t = threading.Thread(); t.isAlive()' :1: DeprecationWarning: isAlive() is deprecated, use is_alive() instead $ python3.9 -c 'import threading; t = threading.Thread(); t.isAlive()' Traceback (most recent call last): File "", line 1, in AttributeError: 'Thread' object has no attribute 'isAlive' Fixes https://github.com/micheles/decorator/issues/75 --- src/tests/documentation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/documentation.py b/src/tests/documentation.py index 2888ea1..bd3367c 100644 --- a/src/tests/documentation.py +++ b/src/tests/documentation.py @@ -1531,7 +1531,7 @@ def blocking(f, msg='blocking', *args, **kw): f.thread = threading.Thread(None, set_result) f.thread.start() return msg - elif f.thread.isAlive(): + elif f.thread.is_alive(): return msg else: # the thread is ended, return the stored result del f.thread -- cgit v1.2.1