summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-02-23 04:42:19 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-02-23 04:42:19 (GMT)
commit1ca8794f10b4cb1eda064baea203bec3d6de6cbf (patch)
tree15d77dc36af0a4ea537a16ad93313f1931fb4604 /Lib/test
parent29267c81ce2bca421f1ba044491200b41ed5cfd2 (diff)
downloadcpython-1ca8794f10b4cb1eda064baea203bec3d6de6cbf.zip
cpython-1ca8794f10b4cb1eda064baea203bec3d6de6cbf.tar.gz
cpython-1ca8794f10b4cb1eda064baea203bec3d6de6cbf.tar.bz2
#17249: check for the availability of the thread module.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_capi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
index d61bf36..0ab1458 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -8,7 +8,6 @@ import random
import subprocess
import sys
import time
-import _thread
import unittest
from test import support
try:
@@ -16,8 +15,10 @@ try:
except ImportError:
_posixsubprocess = None
try:
+ import _thread
import threading
except ImportError:
+ _thread = None
threading = None
import _testcapi
@@ -223,7 +224,7 @@ class EmbeddingTest(unittest.TestCase):
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