From decf83d4033cd5735f4f731f689e63dab425fb1e Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sat, 16 Sep 2017 07:01:47 -0400 Subject: [PATCH] Replace scandir with listdir, simplify loop FIXES: ?? --- src/modules/displaymanager/main.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/modules/displaymanager/main.py b/src/modules/displaymanager/main.py index 99a25ad4a..39f07f334 100644 --- a/src/modules/displaymanager/main.py +++ b/src/modules/displaymanager/main.py @@ -484,12 +484,9 @@ def run(): ) if (os.path.exists(greeter_path)): - greeter_configured = False - # configure first found lightdm-greeter - for entry in os.scandir(greeter_path): - if entry.name.endswith('.desktop') \ - and not greeter_configured: + for entry in os.listdir(greeter_path): + if entry.name.endswith('.desktop'): greeter = entry.name.split('.')[0] libcalamares.utils.debug( "found greeter {!s}".format(greeter) @@ -504,9 +501,8 @@ def run(): libcalamares.utils.debug( "{!s} configured as greeter.".format(greeter) ) - greeter_configured = True - - if not greeter_configured: + break + else: return ("No lightdm greeter installed.") else: libcalamares.utils.debug("lightdm selected but not installed")