Fix 5379, 5429 (#5432)

Fix described in
https://github.com/xonsh/xonsh/issues/5358#issuecomment-2104322754
Closes #5379, #5429

## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**
This commit is contained in:
Andy Kipp 2024-05-22 04:57:44 +02:00 committed by GitHub
parent f17b72ca1f
commit f50a9e577c
Failed to generate hash of commit
2 changed files with 25 additions and 1 deletions

23
news/typerr.rst Normal file
View file

@ -0,0 +1,23 @@
**Added:**
* <news item>
**Changed:**
* <news item>
**Deprecated:**
* <news item>
**Removed:**
* <news item>
**Fixed:**
* Fixed ``TypeError`` in xoreutils.
**Security:**
* <news item>

View file

@ -215,7 +215,8 @@ def whichgen(command, path=None, verbose=0, exts=None):
if os.sep in command or os.altsep and os.altsep in command:
if os.path.exists(command):
match = _cull((command, "explicit path given"), matches, verbose)
yield match
if match:
yield match
else:
for i in range(len(path)):
dirName = path[i]