From 75504294b2024935d6a65ca63ca1ff71b71250c6 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Sat, 14 Nov 2020 04:21:27 +0800 Subject: [PATCH] Fix test for Python 3.9 Python 3.9 has neither dummy_thread nor _dummy_thread anymore. Using _thread.allocate_lock passes all tests here. --- src/aspectlib/test.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/aspectlib/test.py b/src/aspectlib/test.py index 5146f6c..e8c5464 100644 --- a/src/aspectlib/test.py +++ b/src/aspectlib/test.py @@ -29,7 +29,10 @@ try: from dummy_thread import allocate_lock except ImportError: - from _dummy_thread import allocate_lock + try: + from _dummy_thread import allocate_lock + except ImportError: + from _thread import allocate_lock try: from collections import OrderedDict except ImportError: