mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #15118: Change return value of os.uname() and os.times() from
plain tuples to immutable iterable objects with named attributes (structseq objects).
This commit is contained in:
parent
f62445ad30
commit
605a62ddb1
10 changed files with 191 additions and 42 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue