Issue #15118: Change return value of os.uname() and os.times() from
plain tuples to immutable iterable objects with named attributes
(structseq objects).
diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py
index 111209a..f0bd66a 100644
--- a/Lib/ctypes/__init__.py
+++ b/Lib/ctypes/__init__.py
@@ -26,7 +26,7 @@
     # libraries.  OS X 10.3 is Darwin 7, so we check for
     # that.
 
-    if int(_os.uname()[2].split('.')[0]) < 8:
+    if int(_os.uname().release.split('.')[0]) < 8:
         DEFAULT_MODE = RTLD_GLOBAL
 
 from _ctypes import FUNCFLAG_CDECL as _FUNCFLAG_CDECL, \
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 61eb094..5555b2e 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -171,9 +171,9 @@
         def _findSoname_ldconfig(name):
             import struct
             if struct.calcsize('l') == 4:
-                machine = os.uname()[4] + '-32'
+                machine = os.uname().machine + '-32'
             else:
-                machine = os.uname()[4] + '-64'
+                machine = os.uname().machine + '-64'
             mach_map = {
                 'x86_64-64': 'libc6,x86-64',
                 'ppc64-64': 'libc6,64bit',
diff --git a/Lib/platform.py b/Lib/platform.py
index 4554659..b7dbcca 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -700,7 +700,7 @@
     pl = plistlib.readPlist(fn)
     release = pl['ProductVersion']
     versioninfo=('', '', '')
-    machine = os.uname()[4]
+    machine = os.uname().machine
     if machine in ('ppc', 'Power Macintosh'):
         # for compatibility with the gestalt based code
         machine = 'PowerPC'
diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py
index f7f1abd..dab1565 100644
--- a/Lib/test/test__locale.py
+++ b/Lib/test/test__locale.py
@@ -12,7 +12,7 @@
 from test.support import run_unittest
 
 if uname()[0] == "Darwin":
-    maj, min, mic = [int(part) for part in uname()[2].split(".")]
+    maj, min, mic = [int(part) for part in uname().release.split(".")]
     if (maj, min, mic) < (8, 0, 0):
         raise unittest.SkipTest("locale support broken for OS X < 10.4")
 
diff --git a/Lib/test/test_locale.py b/Lib/test/test_locale.py
index 7fdb6da..51a7bca 100644
--- a/Lib/test/test_locale.py
+++ b/Lib/test/test_locale.py
@@ -11,7 +11,7 @@
     if sys.platform == 'darwin':
         import os
         tlocs = ("en_US.UTF-8", "en_US.ISO8859-1", "en_US")
-        if int(os.uname()[2].split('.')[0]) < 10:
+        if int(os.uname().release.split('.')[0]) < 10:
             # The locale test work fine on OSX 10.6, I (ronaldoussoren)
             # haven't had time yet to verify if tests work on OSX 10.5
             # (10.4 is known to be bad)
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 3cb63ed..aa5d582 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -14,7 +14,6 @@
                        _get_default_scheme, _expand_vars,
                        get_scheme_names, get_config_var, _main)
 
-
 class TestSysConfig(unittest.TestCase):
 
     def setUp(self):
@@ -26,7 +25,7 @@
             self._uname = os.uname()
         else:
             self.uname = None
-            self._uname = None
+            self._set_uname(('',)*5)
         os.uname = self._get_uname
         # saving the environment
         self.name = os.name
@@ -70,7 +69,7 @@
         super(TestSysConfig, self).tearDown()
 
     def _set_uname(self, uname):
-        self._uname = uname
+        self._uname = os.uname_result(uname)
 
     def _get_uname(self):
         return self._uname
diff --git a/Lib/uuid.py b/Lib/uuid.py
index 5684ad7..0df0743 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -440,7 +440,7 @@
     import sys
     if sys.platform == 'darwin':
         import os
-        if int(os.uname()[2].split('.')[0]) >= 9:
+        if int(os.uname().release.split('.')[0]) >= 9:
             _uuid_generate_random = _uuid_generate_time = None
 
     # On Windows prior to 2000, UuidCreate gives a UUID containing the