diff --git a/Lib/test/test_platform.py b/Lib/test/test_platform.py index 855304a68c2040..998f1e0dc315ab 100644 --- a/Lib/test/test_platform.py +++ b/Lib/test/test_platform.py @@ -167,8 +167,11 @@ def test_uname_processor(self): On some systems, the processor must match the output of 'uname -p'. See Issue 35967 for rationale. """ - proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() - expect = platform._unknown_as_blank(proc_res) + try: + proc_res = subprocess.check_output(['uname', '-p'], text=True).strip() + expect = platform._unknown_as_blank(proc_res) + except (OSError, subprocess.CalledProcessError): + expect = '' self.assertEqual(platform.uname().processor, expect) @unittest.skipUnless(sys.platform.startswith('win'), "windows only test")