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

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


http://hg.python.org/cpython/rev/041d0f68c67d
changeset:   82329:041d0f68c67d
branch:      2.7
parent:      82325:c6ca87fbea39
user:        Ezio Melotti <ezio.melotti at gmail.com>
date:        Sat Feb 23 06:33:51 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
@@ -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 @@
         self.pendingcalls_wait(l, n)
 
 
- at unittest.skipUnless(threading, 'Threading required for this test.')
+ at unittest.skipUnless(threading and thread, 'Threading required for this test.')
 class TestThreadState(unittest.TestCase):
 
     @test_support.reap_threads

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


More information about the Python-checkins mailing list