]> granicus.if.org Git - python/commitdiff
Merged revisions 83696 via svnmerge from
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 4 Aug 2010 00:19:35 +0000 (00:19 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 4 Aug 2010 00:19:35 +0000 (00:19 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r83696 | antoine.pitrou | 2010-08-04 02:18:49 +0200 (mer., 04 août 2010) | 3 lines

  That test was never run (since thread has been renamed to _thread in 3.x)
........

Lib/test/test_threading_local.py

index 2b896ff8134078c5f0c60e282a9eb49e1936adf0..84523ad37ec46be94edc27b5be76343a76beba46 100644 (file)
@@ -126,20 +126,14 @@ def test_main():
     suite.addTest(unittest.makeSuite(ThreadLocalTest))
     suite.addTest(unittest.makeSuite(PyThreadingLocalTest))
 
-    try:
-        from thread import _local
-    except ImportError:
-        pass
-    else:
-        import _threading_local
-        local_orig = _threading_local.local
-        def setUp(test):
-            _threading_local.local = _local
-        def tearDown(test):
-            _threading_local.local = local_orig
-        suite.addTest(DocTestSuite('_threading_local',
-                                   setUp=setUp, tearDown=tearDown)
-                      )
+    local_orig = _threading_local.local
+    def setUp(test):
+        _threading_local.local = _thread._local
+    def tearDown(test):
+        _threading_local.local = local_orig
+    suite.addTest(DocTestSuite('_threading_local',
+                               setUp=setUp, tearDown=tearDown)
+                  )
 
     support.run_unittest(suite)