]> granicus.if.org Git - python/commitdiff
That test was never run (since thread has been renamed to _thread in 3.x)
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 4 Aug 2010 00:18:49 +0000 (00:18 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 4 Aug 2010 00:18:49 +0000 (00:18 +0000)
Lib/test/test_threading_local.py

index 42d745ec9624efdf904c1d969482330825ae5dc1..391bf00e413c6c4155ab822cf3aa5d2e983b422c 100644 (file)
@@ -137,20 +137,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)