From 62150b3030d4de4446d9de74861b83282cf1b5f6 Mon Sep 17 00:00:00 2001 From: Frank Scherrer Date: Fri, 24 Aug 2018 10:44:42 +0200 Subject: [PATCH] trying to remove codeclimate complain * Sorry, I don't have codeclimate * did little refactoring, hope it helps. --- bumblebee/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bumblebee/util.py b/bumblebee/util.py index f5bb4ea..f3545ac 100644 --- a/bumblebee/util.py +++ b/bumblebee/util.py @@ -70,7 +70,9 @@ def which(program): if is_exe(program): return program else: - for path in os.environ["PATH"].split(os.pathsep) + ["/sbin", "/usr/sbin/", "/usr/local/sbin"]: + localPATH = os.environ["PATH"].split(os.pathsep) + localPATH += ["/sbin", "/usr/sbin/", "/usr/local/sbin"] + for path in localPATH: exe_file = os.path.join(path, program) if is_exe(exe_file): return exe_file