mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
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:
parent
5fedb677ca
commit
86b0e2373e
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue