kitty_tests, shell-integration: rework getpwuid() exceptions suppression

This commit is contained in:
usertam
2023-03-20 03:31:23 +08:00
parent 5f9b520ca0
commit 08fa7f19f7
3 changed files with 4 additions and 5 deletions

View File

@@ -176,7 +176,7 @@ env COLORTERM
try:
expected_login_shell = pwd.getpwuid(os.geteuid()).pw_shell
except KeyError:
with suppress(Exception):
with suppress(KeyError):
self.skipTest('Skipping login shell detection as getpwuid() failed to read login shell')
if os.path.basename(expected_login_shell) == 'nologin':
self.skipTest('Skipping login shell detection as login shell is set to nologin')