summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_os.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_os.py')
-rw-r--r--Lib/test/test_os.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 35aa7fa..5432412 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -27,12 +27,15 @@ 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.
-if (hasattr(os, "confstr_names") and
- "CS_GNU_LIBPTHREAD_VERSION" in os.confstr_names):
- libpthread = os.confstr("CS_GNU_LIBPTHREAD_VERSION")
- USING_LINUXTHREADS= libpthread.startswith("linuxthreads")
-else:
- USING_LINUXTHREADS= False
+USING_LINUXTHREADS = False
+if threading:
+ info = threading._info()
+ try:
+ pthread_version = info['pthread_version']
+ except KeyError:
+ pass
+ else:
+ USING_LINUXTHREADS = pthread_version.startswith("linuxthreads")
# Tests creating TESTFN
class FileTests(unittest.TestCase):