Issue #15164: Change return value of platform.uname() from a
plain tuple to a collections.namedtuple.
diff --git a/Lib/test/test__locale.py b/Lib/test/test__locale.py
index f7f1abd..4231f37 100644
--- a/Lib/test/test__locale.py
+++ b/Lib/test/test__locale.py
@@ -11,8 +11,8 @@
from platform import uname
from test.support import run_unittest
-if uname()[0] == "Darwin":
- maj, min, mic = [int(part) for part in uname()[2].split(".")]
+if uname().system == "Darwin":
+ 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_platform.py b/Lib/test/test_platform.py
index cfe623a..6abf443 100644
--- a/Lib/test/test_platform.py
+++ b/Lib/test/test_platform.py
@@ -133,6 +133,12 @@
def test_uname(self):
res = platform.uname()
self.assertTrue(any(res))
+ self.assertEqual(res[0], res.system)
+ self.assertEqual(res[1], res.node)
+ self.assertEqual(res[2], res.release)
+ self.assertEqual(res[3], res.version)
+ self.assertEqual(res[4], res.machine)
+ self.assertEqual(res[5], res.processor)
@unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
def test_uname_win32_ARCHITEW6432(self):
@@ -166,7 +172,7 @@
def test_mac_ver(self):
res = platform.mac_ver()
- if platform.uname()[0] == 'Darwin':
+ if platform.uname().system == 'Darwin':
# We're on a MacOSX system, check that
# the right version information is returned
fd = os.popen('sw_vers', 'r')