From 36144098e39598526ca981762cd4e7fd13c2412a Mon Sep 17 00:00:00 2001 From: Hirokazu Yamamoto Date: Tue, 9 Sep 2008 07:33:27 +0000 Subject: [PATCH] Issue #3806: LockTests in test_imp should be skipped when thread is not available. Reviewed by Benjamin Peterson. --- Lib/test/test_imp.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py index 3a3059e161..1e04f5ad0c 100644 --- a/Lib/test/test_imp.py +++ b/Lib/test/test_imp.py @@ -85,10 +85,16 @@ class ImportTests(unittest.TestCase): def test_main(): - support.run_unittest( - LockTests, - ImportTests, - ) + tests = [ + ImportTests, + ] + try: + import _thread + except ImportError: + pass + else: + tests.append(LockTests) + support.run_unittest(*tests) if __name__ == "__main__": test_main() -- 2.40.0