trying to remove codeclimate complain

* Sorry, I don't have codeclimate
* did little refactoring, hope it helps.
This commit is contained in:
Frank Scherrer 2018-08-24 10:44:42 +02:00
parent 8c12daa407
commit 62150b3030
No known key found for this signature in database
GPG key ID: 6BFD1DE5E5AEDC50

View file

@ -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