Issue #28662: Catch PermissionError in tests when spawning a non existent program

This commit is contained in:
Xavier de Gaye 2016-11-14 17:14:42 +01:00
parent 8bf43e6d0b
commit 38c8b7d292
3 changed files with 6 additions and 4 deletions

View file

@ -1869,7 +1869,8 @@ class TermsizeTests(unittest.TestCase):
"""
try:
size = subprocess.check_output(['stty', 'size']).decode().split()
except (FileNotFoundError, subprocess.CalledProcessError):
except (FileNotFoundError, PermissionError,
subprocess.CalledProcessError):
self.skipTest("stty invocation failed")
expected = (int(size[1]), int(size[0])) # reversed order