Guard against print failure
This commit is contained in:
parent
a0df5b970b
commit
7254a880dc
1 changed files with 4 additions and 1 deletions
|
|
@ -77,7 +77,10 @@ def wakeup():
|
|||
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'
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue