diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-09-09 07:33:27 (GMT) |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2008-09-09 07:33:27 (GMT) |
commit | 36144098e39598526ca981762cd4e7fd13c2412a (patch) | |
tree | 992294e6d6dde319d2228b61707d63453686f5f6 /Lib | |
parent | 8530e8590f4d31b5af66e43bd271b0ea1658ff3e (diff) | |
download | cpython-36144098e39598526ca981762cd4e7fd13c2412a.zip cpython-36144098e39598526ca981762cd4e7fd13c2412a.tar.gz cpython-36144098e39598526ca981762cd4e7fd13c2412a.tar.bz2 |
Issue #3806: LockTests in test_imp should be skipped when thread is not available.
Reviewed by Benjamin Peterson.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_imp.py | 14 |
1 files changed, 10 insertions, 4 deletions
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 @@ 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() |