summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2013-02-23 04:33:51 (GMT)
committerEzio Melotti <ezio.melotti@gmail.com>2013-02-23 04:33:51 (GMT)
commitef1db54ac138a7d850b60a1f623805f5c4f1f7d7 (patch)
tree94f799c7989818868f56a0d3714713283c57edfd
parent2fddfd85bd3d73af7ef26e152d60dc57cbce2a12 (diff)
downloadcpython-ef1db54ac138a7d850b60a1f623805f5c4f1f7d7.zip
cpython-ef1db54ac138a7d850b60a1f623805f5c4f1f7d7.tar.gz
cpython-ef1db54ac138a7d850b60a1f623805f5c4f1f7d7.tar.bz2
#17249: check for the availability of the thread module.
-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 daeae39..0edb3bf 100644
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -4,13 +4,14 @@
from __future__ import with_statement
import sys
import time
-import thread
import random
import unittest
from test import test_support
try:
+ import thread
import threading
except ImportError:
+ thread = None
threading = None
import _testcapi
@@ -97,7 +98,7 @@ class TestPendingCalls(unittest.TestCase):
self.pendingcalls_wait(l, n)
-@unittest.skipUnless(threading, 'Threading required for this test.')
+@unittest.skipUnless(threading and thread, 'Threading required for this test.')
class TestThreadState(unittest.TestCase):
@test_support.reap_threads