Skip to content

Commit

Permalink
Remove casefold since it doesn't exist on bytes (and the code needs t…
Browse files Browse the repository at this point in the history
…o work with str and bytes)
  • Loading branch information
csm10495 committed Sep 29, 2023
1 parent f5a736b commit d93e51f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,8 +1560,8 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
# for a PATHEXT match. The first cmd is the direct match
# (e.g. python.exe instead of python)
# Check that direct match first if and only if the extension is in PATHEXT
suffix = os.path.splitext(files[0])[1].casefold()
if mode & os.X_OK and not any(suffix == ext.casefold() for ext in pathext):
suffix = os.path.splitext(files[0])[1].upper()
if mode & os.X_OK and not any(suffix == ext.upper() for ext in pathext):
del files[0]
else:
# On other platforms you don't have things like PATHEXT to tell you
Expand Down

0 comments on commit d93e51f

Please sign in to comment.