]> granicus.if.org Git - python/commitdiff
Add CS_GNU_LIBC_VERSION and CS_GNU_LIBPTHREAD_VERSION constants for constr(),
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 16 Apr 2010 12:23:43 +0000 (12:23 +0000)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 16 Apr 2010 12:23:43 +0000 (12:23 +0000)
and disable test_execvpe_with_bad_program() of test_os if the libc uses
linuxthreads to avoid the "unknown signal 32" bug (see issue #4970).

Lib/test/test_os.py
Modules/posixmodule.c

index 705bdc7bf36ebe40ead3d5c3654ce62b30ee567a..bbeb20eb154b4a554d6db658c01358788724c15d 100644 (file)
@@ -589,6 +589,15 @@ class URandomTests(unittest.TestCase):
 
 class ExecTests(unittest.TestCase):
     def test_execvpe_with_bad_program(self):
+        try:
+            # 'linuxthreads-0.10' or 'NPTL 2.10.2'
+            pthread = os.confstr("CS_GNU_LIBPTHREAD_VERSION")
+            linuxthreads = pthread.startswith("linuxthreads")
+        except ValueError:
+            linuxthreads = False
+        if linuxthreads:
+            raise unittest.SkipTest(
+                "avoid linuxthreads bug: see issue #4970")
         self.assertRaises(OSError, os.execvpe, 'no such app-', ['no such app-'], None)
 
     def test_execvpe_with_bad_arglist(self):
index fb22eb6bece19f882e190b95c3f26b147e1f453f..7ba7b26078b737ac60c5831fc8ad214f27c3791f 100644 (file)
@@ -6127,6 +6127,12 @@ static struct constdef posix_constants_confstr[] = {
 #ifdef _MIPS_CS_VENDOR
     {"MIPS_CS_VENDOR", _MIPS_CS_VENDOR},
 #endif
+#ifdef _CS_GNU_LIBC_VERSION
+    {"CS_GNU_LIBC_VERSION",    _CS_GNU_LIBC_VERSION},
+#endif
+#ifdef _CS_GNU_LIBPTHREAD_VERSION
+    {"CS_GNU_LIBPTHREAD_VERSION",      _CS_GNU_LIBPTHREAD_VERSION},
+#endif
 };
 
 static int