From: Batuhan Taskaya Date: Sat, 16 May 2020 22:38:02 +0000 (+0300) Subject: bpo-40165: Suppress stderr when checking if test_stty_match should be skipped (GH... X-Git-Tag: v3.9.0b1~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5a980a60790571ec88aba4e011c91e099e31e98;p=thirdparty%2FPython%2Fcpython.git bpo-40165: Suppress stderr when checking if test_stty_match should be skipped (GH-19325) --- diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py index 362ba9e1042c..0db7d30f6385 100644 --- a/Lib/test/test_os.py +++ b/Lib/test/test_os.py @@ -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")