Fix bug in lazy_locate_binary introduced by #1852

We need to explicitly check that a command is not an alias before returning the path. This is necessary since the orignal cased name of an alias is now saved in the first element of the command_cache tuple (i.e. the path element). This bug was introduced in #1852
This commit is contained in:
Morten Enemark Lund 2016-10-18 10:55:41 +02:00
parent 5fedb677ca
commit 86b0e2373e

View file

@ -161,7 +161,8 @@ class CommandsCache(cabc.Mapping):
cached = next((cmd for cmd in possibilities if cmd in self._cmds_cache),
None)
if cached:
return self._cmds_cache[cached][0]
(path, is_alias) = self._cmds_cache[cached]
return path if not is_alias else None
elif os.path.isfile(name) and name != pathbasename(name):
return name