From 13be9af65f6e76ab00be1c6096093e8ce61d2aa7 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 19 Jan 2023 16:24:50 +0100 Subject: [PATCH] Simplify code --- src/user.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/user.py b/src/user.py index b3a2a22e6..05dce8f24 100644 --- a/src/user.py +++ b/src/user.py @@ -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):