#17249: check for the availability of the thread module.

This commit is contained in:
Ezio Melotti 2013-02-23 06:42:19 +02:00
parent 29267c81ce
commit 1ca8794f10
1 changed files with 3 additions and 2 deletions

View File

@ -8,7 +8,6 @@
import subprocess import subprocess
import sys import sys
import time import time
import _thread
import unittest import unittest
from test import support from test import support
try: try:
@ -16,8 +15,10 @@
except ImportError: except ImportError:
_posixsubprocess = None _posixsubprocess = None
try: try:
import _thread
import threading import threading
except ImportError: except ImportError:
_thread = None
threading = None threading = None
import _testcapi import _testcapi
@ -223,7 +224,7 @@ def test_subinterps(self):
os.chdir(oldcwd) 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): class TestThreadState(unittest.TestCase):
@support.reap_threads @support.reap_threads