Issue #11223: Replace threading._info() by sys.thread_info
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 5432412..aa9ff5d 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -27,15 +27,10 @@
 # and unmaintained) linuxthreads threading library.  There's an issue
 # when combining linuxthreads with a failed execv call: see
 # http://bugs.python.org/issue4970.
-USING_LINUXTHREADS = False
-if threading:
-    info = threading._info()
-    try:
-        pthread_version = info['pthread_version']
-    except KeyError:
-        pass
-    else:
-        USING_LINUXTHREADS = pthread_version.startswith("linuxthreads")
+if hasattr(sys, 'thread_info') and sys.thread_info.version:
+    USING_LINUXTHREADS = sys.thread_info.version.startswith("linuxthreads")
+else:
+    USING_LINUXTHREADS = False
 
 # Tests creating TESTFN
 class FileTests(unittest.TestCase):
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index e18019c..61b2676 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -474,6 +474,14 @@
         if not sys.platform.startswith('win'):
             self.assertIsInstance(sys.abiflags, str)
 
+    @unittest.skipUnless(hasattr(sys, 'thread_info'),
+                         'Threading required for this test.')
+    def test_thread_info(self):
+        info = sys.thread_info
+        self.assertTrue(len(info), 3)
+        self.assertIn(info.name, ('nt', 'os2', 'pthread', 'solaris', None))
+        self.assertIn(info.lock, ('semaphore', 'mutex+cond', None))
+
     def test_43581(self):
         # Can't use sys.stdout, as this is a StringIO object when
         # the test runs under regrtest.
diff --git a/Lib/test/test_threading.py b/Lib/test/test_threading.py
index fd63d39..66a04c8 100644
--- a/Lib/test/test_threading.py
+++ b/Lib/test/test_threading.py
@@ -719,16 +719,6 @@
     barriertype = staticmethod(threading.Barrier)
 
 
-class MiscTests(unittest.TestCase):
-    def test_info(self):
-        info = threading._info()
-        self.assertIn(info['name'],
-                      'nt os2 pthread solaris'.split())
-        if info['name'] == 'pthread':
-            self.assertIn(info['lock_implementation'],
-                          ('semaphore', 'mutex+cond'))
-
-
 def test_main():
     test.support.run_unittest(LockTests, PyRLockTests, CRLockTests, EventTests,
                               ConditionAsRLockTests, ConditionTests,
@@ -736,7 +726,7 @@
                               ThreadTests,
                               ThreadJoinOnShutdown,
                               ThreadingExceptionTests,
-                              BarrierTests, MiscTests,
+                              BarrierTests,
                               )
 
 if __name__ == "__main__":
diff --git a/Lib/test/test_threadsignals.py b/Lib/test/test_threadsignals.py
index b0bc607..f975a75 100644
--- a/Lib/test/test_threadsignals.py
+++ b/Lib/test/test_threadsignals.py
@@ -14,9 +14,8 @@
 process_pid = os.getpid()
 signalled_all=thread.allocate_lock()
 
-info = thread.info()
-USING_PTHREAD_COND = (info['name'] == 'pthread'
-                      and info['lock_implementation'] == 'mutex+cond')
+USING_PTHREAD_COND = (sys.thread_info.name == 'pthread'
+                      and sys.thread_info.lock == 'mutex+cond')
 
 def registerSignals(for_usr1, for_usr2, for_alrm):
     usr1 = signal.signal(signal.SIGUSR1, for_usr1)