Cleanup previous PR
This commit is contained in:
parent
122ba17df6
commit
1bed92bed1
@ -176,7 +176,6 @@ env COLORTERM
|
|||||||
try:
|
try:
|
||||||
expected_login_shell = pwd.getpwuid(os.geteuid()).pw_shell
|
expected_login_shell = pwd.getpwuid(os.geteuid()).pw_shell
|
||||||
except KeyError:
|
except KeyError:
|
||||||
with suppress(KeyError):
|
|
||||||
self.skipTest('Skipping login shell detection as getpwuid() failed to read login shell')
|
self.skipTest('Skipping login shell detection as getpwuid() failed to read login shell')
|
||||||
if os.path.basename(expected_login_shell) == 'nologin':
|
if os.path.basename(expected_login_shell) == 'nologin':
|
||||||
self.skipTest('Skipping login shell detection as login shell is set to nologin')
|
self.skipTest('Skipping login shell detection as login shell is set to nologin')
|
||||||
|
|||||||
@ -67,12 +67,12 @@ using_id() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
using_python() {
|
using_python() {
|
||||||
detect_python && output=$(command "$python" -c "import pwd, os; exec(\"try:print(pwd.getpwuid(os.geteuid()).pw_shell)\nexcept:print(os.environ.get('SHELL')or'/bin/sh')\")") \
|
detect_python && output=$(command "$python" -c "import pwd, os; print(pwd.getpwuid(os.geteuid()).pw_shell)" 2>/dev/null) \
|
||||||
&& login_shell="$output" && login_shell_is_ok
|
&& login_shell="$output" && login_shell_is_ok
|
||||||
}
|
}
|
||||||
|
|
||||||
using_perl() {
|
using_perl() {
|
||||||
detect_perl && output=$(command "$perl" -e 'my $shell = (getpwuid($<))[8]; print $shell') \
|
detect_perl && output=$(command "$perl" -e 'my $shell = (getpwuid($<))[8]; print $shell' 2>/dev/null) \
|
||||||
&& login_shell="$output" && login_shell_is_ok
|
&& login_shell="$output" && login_shell_is_ok
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user