Skip to content

Commit d57e3ab

Browse files
committed
Remove use of contextlib.suppress (it would fail with NameError if it had any effect). Rely on _unknown_as_blank to replace unknown with blank.
1 parent f0daf49 commit d57e3ab

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Lib/test/test_platform.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import sys
55
import unittest
66
import collections
7-
import contextlib
87
from unittest import mock
98

109
from test import support
@@ -168,12 +167,8 @@ def test_uname_processor(self):
168167
On some systems, the processor must match the output
169168
of 'uname -p'. See Issue 35967 for rationale.
170169
"""
171-
with contextlib.suppress(subprocess.CalledProcessError):
172-
expect = subprocess.check_output(['uname', '-p'], text=True).strip()
173-
174-
if expect == 'unknown':
175-
expect = ''
176-
170+
proc_res = subprocess.check_output(['uname', '-p'], text=True).strip()
171+
expect = platform._unknown_as_blank(proc_res)
177172
self.assertEqual(platform.uname().processor, expect)
178173

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

0 commit comments

Comments
 (0)