changeset: 82330:01fdf24c9d75 branch: 3.2 parent: 82326:329732a1572f user: Ezio Melotti date: Sat Feb 23 06:42:19 2013 +0200 files: Lib/test/test_capi.py description: #17249: check for the availability of the thread module. diff -r 329732a1572f -r 01fdf24c9d75 Lib/test/test_capi.py --- a/Lib/test/test_capi.py Sat Feb 23 05:52:46 2013 +0200 +++ b/Lib/test/test_capi.py Sat Feb 23 06:42:19 2013 +0200 @@ -8,7 +8,6 @@ import subprocess import sys import time -import _thread import unittest from test import support try: @@ -16,8 +15,10 @@ except ImportError: _posixsubprocess = None try: + import _thread import threading except ImportError: + _thread = None threading = None import _testcapi @@ -223,7 +224,7 @@ os.chdir(oldcwd) -@unittest.skipUnless(threading, 'Threading required for this test.') +@unittest.skipUnless(threading and _thread, 'Threading required for this test.') class TestThreadState(unittest.TestCase): @support.reap_threads