summaryrefslogtreecommitdiff
path: root/src/tests/documentation.py
diff options
context:
space:
mode:
authorMiro Hrončok <miro@hroncok.cz>2020-01-04 23:59:54 +0100
committerMiro Hrončok <miro@hroncok.cz>2020-01-04 23:59:54 +0100
commit482f0833884fe490d50eb03a08eebfb19e9ed46d (patch)
treeac2d3f04558192cdb1a0bd9d7f44b03eb6e4cf3d /src/tests/documentation.py
parentc0dd1f4fd9ce7d994aa97dabda964f921604725b (diff)
downloadpython-decorator-git-482f0833884fe490d50eb03a08eebfb19e9ed46d.tar.gz
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()' <string>: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 "<string>", line 1, in <module> AttributeError: 'Thread' object has no attribute 'isAlive' Fixes https://github.com/micheles/decorator/issues/75
Diffstat (limited to 'src/tests/documentation.py')
-rw-r--r--src/tests/documentation.py2
1 files changed, 1 insertions, 1 deletions
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