mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-05 23:51:29 +02:00
kitty_tests, shell-integration: rework getpwuid() exceptions suppression
This commit is contained in:
@@ -22,10 +22,9 @@ request_data = int('REQUEST_DATA')
|
||||
leading_data = b''
|
||||
login_shell = os.environ.get('SHELL') or '/bin/sh'
|
||||
try:
|
||||
login_shell = pwd.getpwuid(os.geteuid()).pw_shell or login_shell
|
||||
login_shell = pwd.getpwuid(os.geteuid()).pw_shell
|
||||
except KeyError:
|
||||
with contextlib.suppress(Exception):
|
||||
print('Failed to read login shell via getpwuid() for current user, falling back to', login_shell, file=sys.stderr)
|
||||
pass
|
||||
export_home_cmd = b'EXPORT_HOME_CMD'
|
||||
if export_home_cmd:
|
||||
HOME = base64.standard_b64decode(export_home_cmd).decode('utf-8')
|
||||
|
||||
Reference in New Issue
Block a user