From 7254a880dc5e474d83dc75768cdf3b5d0d6348a9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 5 Mar 2018 13:29:26 +0530 Subject: [PATCH] Guard against print failure --- kitty/constants.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kitty/constants.py b/kitty/constants.py index 9ee577d33..d70e6d485 100644 --- a/kitty/constants.py +++ b/kitty/constants.py @@ -77,7 +77,10 @@ logo_data_file = os.path.join(base_dir, 'logo', 'kitty.rgba') try: shell_path = pwd.getpwuid(os.geteuid()).pw_shell or '/bin/sh' except KeyError: - print('Failed to read login shell from /etc/passwd for current user, falling back to /bin/sh', file=sys.stderr) + try: + print('Failed to read login shell via getpwuid() for current user, falling back to /bin/sh', file=sys.stderr) + except Exception: + pass shell_path = '/bin/sh'