Issue #444582: shutil.which() respects relative paths.

This commit is contained in:
Antoine Pitrou 2012-06-22 23:33:05 +02:00
parent 849349de05
commit 07c24d13ed
3 changed files with 13 additions and 3 deletions

View file

@ -1000,7 +1000,7 @@ def which(cmd, mode=os.F_OK | os.X_OK, path=None):
seen = set()
for dir in path:
dir = os.path.normcase(os.path.abspath(dir))
dir = os.path.normcase(dir)
if not dir in seen:
seen.add(dir)
for thefile in files: