Don't assume that os.confstr_names exists.

This commit is contained in:
Mark Dickinson 2010-04-16 13:51:27 +00:00
parent 7cf0389138
commit 89589c90fc
1 changed files with 2 additions and 1 deletions

View File

@ -17,7 +17,8 @@ from test import support
# and unmaintained) linuxthreads threading library. There's an issue
# when combining linuxthreads with a failed execv call: see
# http://bugs.python.org/issue4970.
if "CS_GNU_LIBPTHREAD_VERSION" in os.confstr_names:
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: