]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #3806: LockTests in test_imp should be skipped when thread is not available.
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Mon, 8 Sep 2008 23:38:42 +0000 (23:38 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Mon, 8 Sep 2008 23:38:42 +0000 (23:38 +0000)
Reviewed by Benjamin Peterson.

Lib/test/test_imp.py

index 513ca60884113a89673aed0aa76b3a2f579d8f36..c9682ab59c66d3ee5f782651959c0cd3077220e9 100644 (file)
@@ -56,10 +56,16 @@ class ReloadTests(unittest.TestCase):
 
 
 def test_main():
-    test_support.run_unittest(
-                LockTests,
-                ReloadTests,
-            )
+    tests = [
+        ReloadTests,
+    ]
+    try:
+        import thread
+    except ImportError:
+        pass
+    else:
+        tests.append(LockTests)
+    test_support.run_unittest(*tests)
 
 if __name__ == "__main__":
     test_main()