Skip to content

Commit

Permalink
Rewrite tests and support . in PATHEXT.
Browse files Browse the repository at this point in the history
  • Loading branch information
serhiy-storchaka committed Nov 22, 2024
1 parent b2ec0f6 commit 851c4c2
Show file tree
Hide file tree
Showing 2 changed files with 226 additions and 226 deletions.
2 changes: 1 addition & 1 deletion Lib/shutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
if sys.platform == "win32":
# PATHEXT is necessary to check on Windows.
pathext_source = os.getenv("PATHEXT") or _WIN_DEFAULT_PATHEXT
pathext = [ext for ext in pathext_source.split(os.pathsep) if ext]
pathext = [ext.rstrip('.') for ext in pathext_source.split(os.pathsep) if ext]

if use_bytes:
pathext = [os.fsencode(ext) for ext in pathext]
Expand Down
Loading

0 comments on commit 851c4c2

Please sign in to comment.