Issue #11223: Replace threading._info() by sys.thread_info

This commit is contained in:
Victor Stinner 2011-04-30 14:53:09 +02:00
parent fab6c70770
commit d5c355ccc7
13 changed files with 119 additions and 108 deletions

View file

@ -27,15 +27,10 @@ except ImportError:
# 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):