bpo-40570: Improve compatibility of uname_result with late-bound .platform (#20015)

* bpo-40570: Improve compatibility of uname_result with late-bound .platform.

* Add test capturing ability to cast uname to a tuple.
This commit is contained in:
Jason R. Coombs 2020-05-09 10:12:41 -04:00 committed by GitHub
parent 77c614624b
commit 2c3d508c5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 3 deletions

View file

@ -798,9 +798,10 @@ class uname_result(
)
def __getitem__(self, key):
if key == 5:
return self.processor
return super().__getitem__(key)
return tuple(iter(self))[key]
def __len__(self):
return len(tuple(iter(self)))
_uname_cache = None