bpo-35967 resolve platform.processor late by jaraco · Pull Request #12239 · python/cpython · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
172 changes: 93 additions & 79 deletions Lib/platform.py
9 changes: 2 additions & 7 deletions Lib/test/test_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys
import unittest
import collections
import contextlib
from unittest import mock

from test import support
Expand Down Expand Up @@ -168,12 +167,8 @@ def test_uname_processor(self):
On some systems, the processor must match the output
of 'uname -p'. See Issue 35967 for rationale.
"""
with contextlib.suppress(subprocess.CalledProcessError):
expect = subprocess.check_output(['uname', '-p'], text=True).strip()

if expect == 'unknown':
expect = ''

proc_res = subprocess.check_output(['uname', '-p'], text=True).strip()
expect = platform._unknown_as_blank(proc_res)
self.assertEqual(platform.uname().processor, expect)

@unittest.skipUnless(sys.platform.startswith('win'), "windows only test")
Expand Down