[Python-checkins] r66319 - python/trunk/Lib/test/test_imp.py

hirokazu.yamamoto python-checkins at python.org
Tue Sep 9 01:38:51 CEST 2008


Author: hirokazu.yamamoto
Date: Tue Sep  9 01:38:42 2008
New Revision: 66319

Log:
Issue #3806: LockTests in test_imp should be skipped when thread is not available.
Reviewed by Benjamin Peterson.

Modified:
   python/trunk/Lib/test/test_imp.py

Modified: python/trunk/Lib/test/test_imp.py
==============================================================================
--- python/trunk/Lib/test/test_imp.py	(original)
+++ python/trunk/Lib/test/test_imp.py	Tue Sep  9 01:38:42 2008
@@ -56,10 +56,16 @@
 
 
 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()


More information about the Python-checkins mailing list