bpo-40165: Suppress stderr when checking if test_stty_match should be skipped (GH-19325)

This commit is contained in:
Batuhan Taskaya 2020-05-17 01:38:02 +03:00 committed by GitHub
parent cae2275949
commit d5a980a607
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -3485,7 +3485,11 @@ class TermsizeTests(unittest.TestCase):
should work too.
"""
try:
size = subprocess.check_output(['stty', 'size']).decode().split()
size = (
subprocess.check_output(
["stty", "size"], stderr=subprocess.DEVNULL, text=True
).split()
)
except (FileNotFoundError, subprocess.CalledProcessError,
PermissionError):
self.skipTest("stty invocation failed")