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 362ba9e..0db7d30 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -3485,7 +3485,11 @@
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")