fix util.which if PATH is not in environment
This fixes a test case that failed because PATH was unset in the os.environ.
This commit is contained in:
@@ -1850,7 +1850,7 @@ def which(program):
|
||||
if is_exe(program):
|
||||
return program
|
||||
else:
|
||||
for path in os.environ["PATH"].split(os.pathsep):
|
||||
for path in os.environ.get("PATH", "").split(os.pathsep):
|
||||
path = path.strip('"')
|
||||
exe_file = os.path.join(path, program)
|
||||
if is_exe(exe_file):
|
||||
|
||||
Reference in New Issue
Block a user