Simplify code

This commit is contained in:
Alexandre Aubin 2023-01-19 16:24:50 +01:00 committed by GitHub
parent 36b0f58993
commit 13be9af65f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -127,12 +127,7 @@ def list_shells():
with open("/etc/shells", "r") as f:
content = f.readlines()
shells = []
for line in content:
if line.startswith("/"):
shells.append(line.replace("\n",""))
return shells
return [line.strip() for line in content if line.startswith("/")]
def shellexists(shell):