[Python-checkins] cpython (3.2): #17249: check for the availability of the thread module.

ezio.melotti python-checkins at python.org
Sat Feb 23 05:53:58 CET 2013


http://hg.python.org/cpython/rev/01fdf24c9d75
changeset:   82330:01fdf24c9d75
branch:      3.2
parent:      82326:329732a1572f
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sat Feb 23 06:42:19 2013 +0200
summary:
  #17249: check for the availability of the thread module.

files:
  Lib/test/test_capi.py |  5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_capi.py b/Lib/test/test_capi.py
--- a/Lib/test/test_capi.py
+++ b/Lib/test/test_capi.py
@@ -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)
 
 
- at unittest.skipUnless(threading, 'Threading required for this test.')
+ at unittest.skipUnless(threading and _thread, 'Threading required for this test.')
 class TestThreadState(unittest.TestCase):
 
     @support.reap_threads

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list