Issue #3806: LockTests in test_imp should be skipped when thread is not available.
Reviewed by Benjamin Peterson.
diff --git a/Lib/test/test_imp.py b/Lib/test/test_imp.py
index 3a3059e..1e04f5a 100644
--- a/Lib/test/test_imp.py
+++ b/Lib/test/test_imp.py
@@ -85,10 +85,16 @@
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()