]> granicus.if.org Git - python/commitdiff
Issue #3806: LockTests in test_imp should be skipped when thread is not available.
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Tue, 9 Sep 2008 07:33:27 +0000 (07:33 +0000)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>
Tue, 9 Sep 2008 07:33:27 +0000 (07:33 +0000)
Reviewed by Benjamin Peterson.

Lib/test/test_imp.py

index 3a3059e1619d0b9578fd363f35c654467f677357..1e04f5ad0c187fbbd1a35d06b68649f816bd1946 100644 (file)
@@ -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()