mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
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:
parent
77c614624b
commit
2c3d508c5f
2 changed files with 19 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue