diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2022-11-26 13:28:49 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-26 13:28:49 (GMT) |
commit | dc063a25d29840d863b15c86fdab15b4a1894c73 (patch) | |
tree | c5c4c7fee34050c766fcc1f1e8d317a9f3b81c82 /Lib/platform.py | |
parent | e35ca417fe81a64985c2b29e863ce418ae75b96e (diff) | |
download | cpython-dc063a25d29840d863b15c86fdab15b4a1894c73.zip cpython-dc063a25d29840d863b15c86fdab15b4a1894c73.tar.gz cpython-dc063a25d29840d863b15c86fdab15b4a1894c73.tar.bz2 |
gh-97966: Restore prior expectation that uname_result._fields and ._asdict would include the processor. (gh-98343)
Diffstat (limited to 'Lib/platform.py')
-rwxr-xr-x | Lib/platform.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Lib/platform.py b/Lib/platform.py index 9f5b317..6745321 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -847,6 +847,8 @@ class uname_result( except when needed. """ + _fields = ('system', 'node', 'release', 'version', 'machine', 'processor') + @functools.cached_property def processor(self): return _unknown_as_blank(_Processor.get()) @@ -860,7 +862,7 @@ class uname_result( @classmethod def _make(cls, iterable): # override factory to affect length check - num_fields = len(cls._fields) + num_fields = len(cls._fields) - 1 result = cls.__new__(cls, *iterable) if len(result) != num_fields + 1: msg = f'Expected {num_fields} arguments, got {len(result)}' @@ -874,7 +876,7 @@ class uname_result( return len(tuple(iter(self))) def __reduce__(self): - return uname_result, tuple(self)[:len(self._fields)] + return uname_result, tuple(self)[:len(self._fields) - 1] _uname_cache = None |