summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2012-06-24 11:33:36 (GMT)
committerLarry Hastings <larry@hastings.org>2012-06-24 11:33:36 (GMT)
commit605a62ddb1c19978ee194a40a458f072e3242a31 (patch)
tree68e0896556044c0b2d7e9db9a08fc8e449011f18 /Lib/test
parentf62445ad30145e5e50c5b0ec9d979099b630039f (diff)
downloadcpython-605a62ddb1c19978ee194a40a458f072e3242a31.zip
cpython-605a62ddb1c19978ee194a40a458f072e3242a31.tar.gz
cpython-605a62ddb1c19978ee194a40a458f072e3242a31.tar.bz2
Issue #15118: Change return value of os.uname() and os.times() from
plain tuples to immutable iterable objects with named attributes (structseq objects).
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test__locale.py2
-rw-r--r--Lib/test/test_locale.py2
-rw-r--r--Lib/test/test_sysconfig.py5
3 files changed, 4 insertions, 5 deletions
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 platform import uname
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 @@ def get_enUS_locale():
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 @@ from sysconfig import (get_paths, get_platform, get_config_vars,
_get_default_scheme, _expand_vars,
get_scheme_names, get_config_var, _main)
-
class TestSysConfig(unittest.TestCase):
def setUp(self):
@@ -26,7 +25,7 @@ class TestSysConfig(unittest.TestCase):
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 @@ class TestSysConfig(unittest.TestCase):
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