mirror of https://github.com/python/cpython.git
#17249: check for the availability of the thread module.
This commit is contained in:
parent
29267c81ce
commit
1ca8794f10
|
@ -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 @@ def test_subinterps(self):
|
|||
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
|
||||
|
|
Loading…
Reference in New Issue